Install wxPython 4 for MSYS2

I've used wxPython 4 (4.0.1) on macos by simply installing with "pip3.6
install wxPython".

I've also done this on Windows before using the Python.org install of
python.

I tried doing "pip3.6 install wxPython" from and msys2 mingw64 shell but
it didn't install/build.

It complains with `distutils.errors.DistutilsPlatformError: VC 6.0 is
not supported by this module`

It seems the msvc9compiler.py file is looking at `sys.version` to find
the sub-string `MSC v.`, which isn't in `sys.version`, so VERSION is set
to the default of 6.

Is this an msys2/mingw issue or a python issue? How do I go about
getting this to work?

Once I've installed wxPython, am I also able to use C++ to build a C++
app using the same wxWidgets librariers that wxPython uses (using
wx-config, etc)?

    brend@BJS_DELL_17 MINGW64 ~
    $ pip3.6 install -U wxPython
    Collecting wxPython
     Using cached
    https://files.pythonhosted.org/packages/a4/4a/d35b19f8c21b414ece2b3dc02dcf8cb0d45d6fe5aacf56f7ca0b7c66ac58/wxPython-4.0.1.tar.gz
    Requirement not upgraded as not directly required: six in
    c:/msys64/mingw64/lib/python3.6/site-packages (from wxPython) (1.11.0)
    Installing collected packages: wxPython
     Running setup.py install for wxPython ... error
     Complete output from command C:/msys64/mingw64/bin/python3.exe
    -u -c "import setuptools,
    tokenize;__file__='C:/Users/brend/AppData/Local/Temp/pip-install-8le1c189/wxPython/setup.py';f=getattr(tokenize,
    'open', open)(__file__);code=f.read().replace('\r\n',
    '\n');f.close();exec(compile(code, __file__, 'exec'))" install
    --record
    C:/Users/brend/AppData/Local/Temp/pip-record-p71raf86/install-record.txt
    --single-version-externally-managed --compile:
     running install
     running build
     WARNING: Building this way assumes that all generated files have
    been
     generated already. If that is not the case then use build.py
    directly
     to generate the source and perform the build stage. You can use
     --skip-build with the bdist_* or install commands to avoid this
     message and the wxWidgets and Phoenix build steps in the future.

     "C:/msys64/mingw64/bin/python3.exe" -u build.py build
     Will build using: "C:/msys64/mingw64/bin/python3.exe"
     3.6.5 (default, Apr 16 2018, 10:17:38) [GCC 7.3.0 64 bit (AMD64)]
     Python's architecture is 64bit
     cfg.VERSION: 4.0.1

     Running command: build
     Running command: build_wx
     Command '"C:/msys64/mingw64/bin/python3.exe" -c "import
    distutils.msvc9compiler as msvc; mc = msvc.MSVCCompiler();
    mc.initialize(); print(mc.cc)"' failed with exit code 1.
     Traceback (most recent call last):
     File "<string>", line 1, in <module>
     File
    "C:/msys64/mingw64/lib/python3.6\distutils\msvc9compiler.py", line
    297, 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
     Finished command: build_wx (0.124s)
     Finished command: build (0.124s)
     Command '"C:/msys64/mingw64/bin/python3.exe" -u build.py build'
    failed with exit code 1.

···
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-

    Command "C:/msys64/mingw64/bin/python3.exe -u -c "import setuptools,
    tokenize;__file__='C:/Users/brend/AppData/Local/Temp/pip-install-8le1c189/wxPython/setup.py';f=getattr(tokenize,
    'open', open)(__file__);code=f.read().replace('\r\n',
    '\n');f.close();exec(compile(code, __file__, 'exec'))" install
    --record
    C:/Users/brend/AppData/Local/Temp/pip-record-p71raf86/install-record.txt
    --single-version-externally-managed --compile" failed with error
    code 1 in
    C:/Users/brend/AppData/Local/Temp/pip-install-8le1c189/wxPython/

Thanks,
Brendan.

Do you need msys2? Then you probably need to patch the detection to return the correct version and maybe submit a bug report to the msys2 people.

If you don't need msys2:
Usually, you need cygwin for the build process as build.py calls a bash shell script, but the build command itself can run outside.

E.g.:
D:/Python/Python36/python.exe build.py dox etg --nodoc sip build

Regards,

Dietmar

···

On 5/11/2018 6:38 AM, Brendan Simon (eTRIX) wrote:

Is this an msys2/mingw issue or a python issue? How do I go about getting this to work?

I don’t strictly need to use msys2, but I’ve started using it at work (in preference to cygwin as it is supposed to be more Windows friendly), so I wanted to use the same tools for a work based wx C++ app. Msys2 does have wxwidgets 3.0.4 (and wxPython 3 with python 2.7), but I was also wanting to use wxPython 4 with Python 3.6 (as I do on my Mac) and keep the same version of tools (that’s all !!)

Some options are:
* msys2 with wxwidgets 3.0.4 and msys2 gcc/clang compilers (using wxglade generated C++ layouts).
* Use official Python (3.6 or whatever) + pip install wxPython (assuming I can C++ compile against the associated wxwidgets libs)
* Use msys2 gcc/clang compilers to build/install wxwidgets from source (my least preferred option).

Msys2 does have a few disadvantages. One major one is it’s not possible to have multiple versions of packages, so not easy to have various versions for various projects.

I’ll keep experimenting

···

On Friday, 11 May 2018 19:39:57 UTC+10, Dietmar Schwertberger wrote:

  On 5/11/2018 6:38 AM, Brendan Simon > (eTRIX) wrote:
         Is this an msys2/mingw issue

or a python issue? How do I go about getting this to work?

      Do you need msys2? Then you

probably need to patch the detection to return the correct
version and maybe submit a bug report to the msys2 people.

If you don’t need msys2:

      Usually, you need cygwin for the build process as build.py

calls a bash shell script, but the build command itself can
run outside.

E.g.:

      D:/Python/Python36/python.exe build.py dox etg --nodoc sip

build

Is it even possible under Windows for a Python 3.6 to use another compiler than VC++ 2015? I remember that the last Python I was able to compile C extensions with mingw32 was Python 3.4.