You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Win11+Python3.10下pip安装pandas报错AttributeError,求助解决

pandas安装报错解决方法

环境信息

  • Python 3.10.0
  • Windows 11

执行pip install pandas时出现以下报错:

Collecting pandas
  Using cached pandas-1.5.2.tar.gz (5.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "d:\py\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
          main()
        File "d:\py\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "d:\py\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 112, in get_requires_for_build_wheel
          backend = _build_backend()
        File "d:\py\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 77, in _build_backend
          obj = import_module(mod_path)
        File "d:\py\lib\importlib\__init__.py", line 126, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
        File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
        File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
        File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
        File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 790, in exec_module
        File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
        File "C:\Users\zijie\AppData\Local\Temp\pip-build-env-kqsd82rz\overlay\Lib\site-packages\setuptools\__init__.py", line 18, in <module>
          from setuptools.dist import Distribution
        File "C:\Users\zijie\AppData\Local\Temp\pip-build-env-kqsd82rz\overlay\Lib\site-packages\setuptools\dist.py", line 47, in <module>
          from . import _entry_points
        File "C:\Users\zijie\AppData\Local\Temp\pip-build-env-kqsd82rz\overlay\Lib\site-packages\setuptools\_entry_points.py", line 43, in <module>
          def validate(eps: metadata.EntryPoints):
      AttributeError: module 'importlib.metadata' has no attribute 'EntryPoints'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

解决方法

方法一:降级setuptools到兼容版本

错误根源是高版本setuptools依赖Python 3.10中不存在的importlib.metadata.EntryPoints属性,先执行降级:

pip install setuptools==60.2.0

完成后再安装pandas:

pip install pandas

方法二:直接安装预编译wheel包

跳过源码编译步骤,指定安装预编译版本:

pip install pandas==1.5.2 --only-binary :all:

辅助步骤:升级pip到最新版本

如果上述方法无效,先更新pip:

python -m pip install --upgrade pip

内容的提问来源于stack exchange,提问作者user20401002

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 15:15:10