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

PyCharm中安装pandas失败:VC 6.0不兼容错误求助

问题:PyCharm安装pandas失败,提示VC 6.0不支持

使用PyCharm作为IDE,尝试安装pandas时遭遇编译错误,核心报错信息为distutils.errors.DistutilsPlatformError: VC 6.0 is not supported by this module,完整报错日志如下:

Using cached pandas-2.0.2.tar.gz (5.3 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'

  error: subprocess-exited-with-error
  
  pip subprocess to install build dependencies did not run successfully.
  exit code: 1
  
  [76 lines of output]
  Collecting setuptools>=61.0.0
    Using cached setuptools-67.8.0-py3-none-any.whl (1.1 MB)
  Collecting wheel
    Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
  Collecting Cython<3,>=0.29.33
    Using cached Cython-0.29.35-py2.py3-none-any.whl (988 kB)
  Collecting oldest-supported-numpy>=2022.8.16
    Using cached oldest_supported_numpy-2022.11.19-py3-none-any.whl (4.9 kB)
  Collecting versioneer[toml]
    Using cached versioneer-0.28-py3-none-any.whl (45 kB)
  Collecting numpy==1.19.3
    Using cached numpy-1.19.3.zip (7.3 MB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'error'
    error: subprocess-exited-with-error
  
    Getting requirements to build wheel did not run successfully.
    exit code: 1
  
    [40 lines of output]
    Traceback (most recent call last):
      File "C:\Users\90538\PycharmProjects\CSV\venv\lib\python3.9\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
        main()
      File "C:\Users\90538\PycharmProjects\CSV\venv\lib\python3.9\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "C:\Users\90538\PycharmProjects\CSV\venv\lib\python3.9\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 112, in get_requires_for_build_wheel
        backend = _build_backend()
      File "C:\Users\90538\PycharmProjects\CSV\venv\lib\python3.9\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 77, in _build_backend
        obj = import_module(mod_path)
      File "C:\msys64\mingw64\lib\python3.9\importlib\__init__.py", line 127, 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 850, in exec_module
      File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
      File "C:\Users\90538\AppData\Local\Temp\pip-build-env-nnvi2xem\overlay\lib\python3.9\site-packages\setuptools\__init__.py", line 253, in <module>
        monkey.patch_all()
      File "C:\Users\90538\AppData\Local\Temp\pip-build-env-nnvi2xem\overlay\lib\python3.9\site-packages\setuptools\monkey.py", line 101, in patch_all
        patch_for_msvc_specialized_compiler()
      File "C:\Users\90538\AppData\Local\Temp\pip-build-env-nnvi2xem\overlay\lib\python3.9\site-packages\setuptools\monkey.py", line 164, in patch_for_msvc_specialized_compiler
        patch_func(*msvc9('find_vcvarsall'))
      File "C:\Users\90538\AppData\Local\Temp\pip-build-env-nnvi2xem\overlay\lib\python3.9\site-packages\setuptools\monkey.py", line 151, in patch_params
        mod = import_module(mod_name)
      File "C:\msys64\mingw64\lib\python3.9\importlib\__init__.py", line 127, 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 986, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 850, in exec_module
      File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
      File "C:\Users\90538\AppData\Local\Temp\pip-build-env-nnvi2xem\overlay\lib\python3.9\site-packages\setuptools\_distutils\msvc9compiler.py", line 295, in <module>
        raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION)
    distutils.errors.DistutilsPlatformError: VC 6.0 is not supported by this module
    [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.
  
  [notice] A new release of pip available: 22.3.1 -> 23.1.2
  [notice] To update, run: python.exe -m pip install --upgrade pip
  [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

pip subprocess to install build dependencies 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.

[notice] A new release of pip available: 22.3.1 -> 23.1.2
[notice] To update, run: python.exe -m pip install --upgrade pip

已提供Python、pip版本及Python解释器的截图参考,当前使用的是MSYS2环境下的Python 3.9。


解决方案

1. 替换为官方Windows Python解释器

当前使用的MSYS2 Python在编译依赖时易与Windows VC环境冲突,建议切换到官方版本:

  • 下载对应版本的官方Windows Python(Python 3.9.x)
  • 在PyCharm中操作:File > Settings > Project: [你的项目名] > Python Interpreter,点击齿轮图标选择Add,定位到刚安装的官方Python路径,替换当前解释器

2. 直接安装预编译wheel包

跳过源码编译,用pip安装预编译好的pandas包:
在PyCharm终端执行:

# 先升级pip到最新版本
python.exe -m pip install --upgrade pip
# 安装预编译的pandas
pip install pandas --only-binary :all:

3. 安装兼容的VC编译工具(可选,若坚持用MSYS2 Python)

  • 安装Visual Studio Build Tools,勾选「Desktop development with C++」组件,确保包含VC 14.x及以上版本的工具链
  • 配置环境变量,让MSYS2能正确识别VC工具链

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.19 04:17:35