8

I try to install a package in Windows 10 (mingw64) and get this error:

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

What can I do to fix this?

I was following these instructions to set up my development environment: https://www.gtk.org/download/windows.php

Update

Just for the records, I switched from gtk to qt (PySide2) and now I can use the default Python for windows. Everything is much easier now.

guettli
  • 25,042
  • 81
  • 346
  • 663
  • 2
    This seems like GTK+ for Windows is a hacked-together product. MSYS2, MinGW, and still a MSVC dependency. The instructions don't mention it, but the error strongly suggests that you need at least the Visual Studio build tools if not the whole Visual Studio IDE installed. – MSalters Sep 04 '18 at 13:30
  • @MSalters yes, you are right gtk for windows seams to be fragile and without good support. Too few people use it today. Since the code base is quite small, we will change to QT. This way we can use the default python for windows, and do not need msys2/mingw. – guettli Sep 05 '18 at 07:12

1 Answers1

12

In MSYS2, many of the issues are patched downstream with the MINGW-packages that go in to the pacman repository. In this case, the reason you are getting this error is that you have setuptools pip installed, instead of installed using the pacman repository. To fix this issue:

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

or if you are using modern Python:

pip3 uninstall setuptools
pacman -S mingw-w64-x86_x64-python3-setuptools
Dan Yeaw
  • 741
  • 8
  • 16
  • It somehow feels strange if issues get patched downstream and not upstream. I switched from python+gtk to PySide and have no such issues since I switched. Nevertheless thank you for your answer. I might help other people how need to use mingw. – guettli Apr 08 '19 at 07:13
  • The package name is `mingw64/mingw-w64-x86_64-python2-setuptools`, didn't work without `mingw64/` for me. – feos May 28 '19 at 11:47
  • 1
    What will the command be for windows? – sebsmgzz Jul 02 '22 at 10:11
  • I got the same problem due to MSYS2 as above. My solution is utilizing Conda's pip instead – Yuh Lee May 17 '23 at 09:47
  • [Alas, this no longer helps](https://github.com/msys2/MINGW-packages/issues/18192). – sds Aug 15 '23 at 17:01