DistutilsPlatformError in mingw built Python 2 (msys2)
See original GitHub issueTrying to do many things using setuptools in a mingw built Python 2 (For example msys2
’s mingw-w64-x86_64-python2
fails with this exception:
$ python setup.py build_ext
Traceback (most recent call last):
File "setup.py", line 1, in <module>
from setuptools import setup, Extension
File "mingw64/lib/python2.7/site-packages/setuptools/__init__.py", line 160, in <module>
monkey.patch_all()
File "mingw64/lib/python2.7/site-packages/setuptools/monkey.py", line 104, in patch_all
patch_for_msvc_specialized_compiler()
File "mingw64/lib/python2.7/site-packages/setuptools/monkey.py", line 156, in patch_for_msvc_specialized_compiler
msvc = import_module('setuptools.msvc')
File "mingw64/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "mingw64/lib/python2.7/site-packages/setuptools/msvc.py", line 49, in <module>
from distutils.msvc9compiler import Reg
File "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
distutils.msvc9compiler
doesn’t like being imported on mingw built Python, and this hack isn’t necessary there.
P.S. I’m going to send a PR.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
msys2/mingw64: pip: VC 6.0 is not supported by this module
1 Answer 1 · It somehow feels strange if issues get patched downstream and not upstream. I switched from python+gtk to PySide and...
Read more >Distutils VC 6.0 Errors When Using mingw-w64 GCC
I am using the mingw-w64-x86_64-python3 in MSYS2 on Windows to package a PyGObject app. When I try to pip install the app, ...
Read more >mingw-w64-x86_64-python2 - MSYS2 Packages
Package: mingw-w64-x86_64-python2. A high-level scripting language (mingw-w64). Source Files · View Changes · Bug Reports · Add New Bug.
Read more >Python - MSYS2
In some cases we provide patched versions in our repo. setuptools >= 60.0 is currently incompatible with MSYS2. You can set export SETUPTOOLS_USE_DISTUTILS= ......
Read more >mingw-w64-x86_64-python-pip - MSYS2 Packages
The PyPA recommended tool for installing Python packages. ... /lib/python3.10/site-packages/pip/_internal/operations/build/__init__.py ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@krzychb A quick workaround would be to allow the function to continue, even without the ‘required’ compiler.
In your case, in the file
C:/msys32/mingw32/lib/python2.7/distutils/msvc9compiler.py
remark line 306, and add the pass statement, so that the code looks more or less like the following:This probably should do the trick…
Somehow, over a year later, this is still an issue. In my case not related to setuptools though - I used python3-pip from mingw64 to install bcrypt. Same error, same remedy. Thank you @PeterMosmans.