【问题标题】:msys2/mingw64: pip: VC 6.0 is not supported by this modulemsys2/mingw64:pip:此模块不支持 VC 6.0
【发布时间】:2018-09-04 12:58:00
【问题描述】:

我尝试在 Windows 10 (mingw64) 中安装一个包并收到此错误:

IEUser@MSEDGEWIN10 MINGW64 /c/Users/IEUser/PycharmProjects/myapp_msi-msys/myapp_msi
$ pip  install -e git+https://source.example.lan:40443/repos/myapp_common#egg=myapp_common
Obtaining myapp_common from git+https://source.example.lan:40443/repos/myapp_common#egg=myapp_common
  Cloning https://source.example.lan:40443/repos/myapp_common to c:/users/ieuser/pycharmprojects/myapp_msi-msys/myapp_msi/src/myapp-common
Username for 'https://source.example.lan:40443':
Password for 'https://tguettler@source.example.lan:40443':
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:/msys64/mingw64/lib/python2.7/site-packages/setuptools/__init__.py", line 191, in <module>
        monkey.patch_all()
      File "C:/msys64/mingw64/lib/python2.7/site-packages/setuptools/monkey.py", line 101, in patch_all
        patch_for_msvc_specialized_compiler()
      File "C:/msys64/mingw64/lib/python2.7/site-packages/setuptools/monkey.py", line 164, in patch_for_msvc_specialized_compiler
        patch_func(*msvc9('find_vcvarsall'))
      File "C:/msys64/mingw64/lib/python2.7/site-packages/setuptools/monkey.py", line 151, in patch_params
        mod = import_module(mod_name)
      File "C:/msys64/mingw64/lib/python2.7/importlib/__init__.py", line 37, in import_module
        __import__(name)
      File "C:/msys64/mingw64/lib/python2.7/distutils/msvc9compiler.py", line 306, 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

我能做些什么来解决这个问题?

我按照以下说明设置我的开发环境:https://www.gtk.org/download/windows.php

更新

为了记录,我从 gtk 切换到 qt (PySide2),现在我可以使用默认的 Python for windows。现在一切都容易多了。

【问题讨论】:

  • 这似乎是用于 Windows 的 GTK+ 是一个被破解的产品。 MSYS2、MinGW,仍然是一个 MSVC 依赖项。说明没有提及,但该错误强烈表明如果不安装整个 Visual Studio IDE,您至少需要 Visual Studio 构建工具。
  • @MSalters 是的,你是正确的 gtk,因为 windows 接缝很脆弱并且没有良好的支持。今天用的人太少了。由于代码库很小,我们将更改为 QT。这样我们就可以使用windows默认的python,不需要msys2/mingw。

标签: python pip mingw msys2


【解决方案1】:

在 MSYS2 中,许多问题都通过进入 pacman 存储库的 MINGW 包在下游进行了修补。在这种情况下,您收到此错误的原因是您安装了 setuptools pip,而不是使用 pacman 存储库安装。要解决此问题:

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

或者如果您使用的是现代 Python:

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

【讨论】:

  • 如果问题在下游而不是上游得到修补,感觉有点奇怪。我从 python+gtk 切换到 PySide 并且自从我切换以来没有这样的问题。不过还是谢谢你的回答。我可能会帮助其他人如何需要使用 mingw。
  • 包名是mingw64/mingw-w64-x86_64-python2-setuptools,没有mingw64/对我来说是不行的。
猜你喜欢
  • 2017-05-31
  • 2018-08-04
  • 2016-03-14
  • 2019-08-04
  • 2014-06-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多