question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DistutilsPlatformError in mingw built Python 2 (msys2)

See original GitHub issue

Trying 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
PeterMosmanscommented, Nov 21, 2017

@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:

+---[C:/msys32/mingw32/lib/python2.7/distutils/msvc9compiler.py:309]
| 
| # More globals
| VERSION = get_build_version()
| if VERSION < 8.0:
|     pass
| #    raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION)
| # MACROS = MacroExpander(VERSION)
| 
+---

This probably should do the trick…

1reaction
mefistoteliscommented, Dec 13, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found