[mingw-w64-x86_64-python in MSYS2] VC 6.0 is not supported by this module

以安装库顺序与出现各种error可能性顺序叙述

一、按照正常教程_使用国内源pip安装

在安装python第三方库pandas(后测试时发现多个第三方库在此时都会出现这类问题)的时候,最初使用pip安装时安装成功,可以imprt PIL,但是当运行from pIL import image 的时候,就会报错,说没有这个model。


在转至下一步前,先确定是否是由于其他问题引起的

1、首先确定是否安装pandas:确定/site-package文件夹中含有pandas

2、确定安装了pandas但无法识别出来,输入pip show pandas 查看能否输出pandas详细信息。

  A、在输出的详细信息中查看pandas版本,查看是否存在pandas版本过老的问题

  B、如果不能输出详细信息,显示无法找到“pandas”

    a、因为pythonpath中设置的路径不正确。在windows中下载了多个python,在设置环境变量-系统变量-PATH时,将其他python的路径设在所用python的路径之上。

    Ps:C:\msys64\mingw64\bin这一个路径不仅指向了其中的C++,还指向了其中的python,当这一个路径位于你本想使用的python的路径之上时,指向的python为C:\msys64\mingw64\bin中的python。假如你使用的python为anaconda或者其他python,应该将所使用的python路径置于更上方。

      出现error形式如下(× Getting requirements to build wheel did not run successfully.)

  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [3 lines of output]
      setup.py:117: UserWarning: Unable to determine GEOS version. Ensure you have 3.7.2 or later installed, or installation may fail.
        warnings.warn(
      Proj 8.0.0 must be installed.
      [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.

      error形式与下列error形式相同,而且使用.whl文件下载并无效果,依旧会出现此error形式报错,但其实只需更改环境变量-系统变量-PATH的设置即可。

使用pip安装Cartopy库时,出现报错:Getting requirements to build wheel did not run successfully._LorettaWang的博客-CSDN博客icon-default.png?t=N6B9https://blog.csdn.net/qq_37598092/article/details/123652853

      假如出现此问题,有大概率同时存在由于更新了自身pip版本导致路径更新的问题,故在此增述。若确有其事,在更正了环境变量-系统变量-PATH的设置之后,可按照下列教程配置pip install默认安装路径,避免再使用pip下载的库安装至其他python的site-package文件夹中

【超详细 图解】 修改pip install 默认安装路径_pip位置_点绛蓝的博客-CSDN博客icon-default.png?t=N6B9https://blog.csdn.net/m0_46336403/article/details/120042473

    b、如果是使用anaconda,则可能存在conda list与pip list之间的不相同问题:(下列引用一篇文章具体阐述两个指令之间区别所在)同一个虚拟环境下的conda list和pip list里的包不一样,这是为什么,它们有什么区别_程序猿的探索之路的博客-CSDN博客icon-default.png?t=N6B9https://blog.csdn.net/nyist_yangguang/article/details/111304014

       如果也是上述B类情况,将anaconda中所虚拟的python环境路径置于C:\msys64\mingw64\bin之上即可,pip路径设置好之后,conda和pip所读取的python库就都为anaconda所虚拟的python环境文件夹中的/Lib/site-package中的库


据说是官方库本身有问题,于是尝试.whl文件pip 方式安装

二、使用.whl文件pip方式安装

关于如何下载安装whl轮子以及确定Python适配版本:如何下载安装whl轮子以及确定Python适配版本_下载whl_Mr.zwX的博客-CSDN博客1 配置好Python环境这个默认是已经配置好了,也能在编辑器正常编译运行Python程序。同时,也能正常使用pip包管理工具进行第三方库的下载安装。或者,根据自己的环境需要,能进入到自己的Python虚拟环境下工作,命令:activate env_name。如上均是下载安装whl文件的前提条件,这里不会展开说明…2 安装wheelpip install wheel3 下载whl轮子文件(重点是如何确定适配版本)给两个常用的资源链接:https://pypi.org/https://ww_下载whlhttps://blog.csdn.net/qq_16763983/article/details/118674124

MSYS2版流程: 与上列教程在流程大致一致

区别在于使用pip debug --verbose指令时,所输出的compatible tags中,后缀并不是cpxx-cpxx-win_amd64或者cpxx-abi3-win_amd64,而多为cpxx-abi3-mingw_x86_64

在网站https://www.lfd.uci.edu/~gohlke/pythonlibs中是找不到这个后缀的.whl文件的,所以自行根据自己的python版本和位数选择相对应的.whl文件

在选择好.whl文件下载后,自行将后缀改成所需的后缀。形如:Pillow-9.1.1-cp39-abi3-mingw_x86_64.whl,即可正常按照上列教程下载

三、VC 6.0 is not supported by this module

使用上述一、二两种方式,即直接pip install或者conda install、和使用.whl下载时都出现此形式error(包括不限于pandas、numpy、opencv、deepface)

      出现error形式如下:

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.

      error原因:MSYS2 patches setuptools to work with GCC and the MSYS2 Python, so you can't use setuptools as is from pip. 


      1、摘自github中python第80720issues的解决方法一:

      See https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-python-setuptools for the current set of patches.

      2、摘自github中python第80720issues的解决方法二:

      删除现有的setuptools,转而使用pacman repo中的setuptools(删除需谨慎)

pip uninstall setuptools
pacman -S mingw-w64-x86_64-python-setuptools

      如果使用的是 python3: 

pip3 uninstall setuptools
pacman -S mingw-w64-x86_x64-python3-setuptools 

      1,2部分参考:https://github.com/python/cpython/issues/80720

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值