Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.4 MSW builds #363

Closed
lvu opened this issue May 17, 2017 · 18 comments
Closed

Python 3.4 MSW builds #363

lvu opened this issue May 17, 2017 · 18 comments

Comments

@lvu
Copy link
Contributor

lvu commented May 17, 2017

Is it possible to start building wheels for MSW with python 3.4 again? https://pypi.python.org/pypi/wxPython/4.0.0a2 says that python 3.4 is supported, but there are no 3.4 builds neither on PyPI nor in snapshot builds anymore :(

@ZanderBrown
Copy link

Attempted to build using sudo pip3 install wxpython on Raspbian and failed silently
Any ideas why? When was 3.4 dropped?

@RobinD42
Copy link
Member

RobinD42 commented May 18, 2017

3.4 hasn't been dropped, it's just not a priority since there are 2 major releases newer than 3.4. When Python 3.7 is released then I'll probably stop building for 3.5 even though wxPython will likely remain compatible with 3.5 for some time.

For the raspian build, pip hides most of the build output by default, so you'll probably want to use the --log option so you can capture the full build output and get some clues as to why the build failed. (Probably some missing dependencies or similar.)

@lvu
Copy link
Contributor Author

lvu commented May 22, 2017

Unfortunately, I don't own a copy of MS Windows, and I have issues building wxPython under Wine; I keep getting the following error:

    	cl /c /nologo /TP /Fovc100_mswudll\basedll_dummy.obj /MD /DWIN32  /Zi  /Fd..\..\lib\vc100_dll\wxbase30u_vc100.pdb   /O2 /D_CRT_SECURE_NO_DEPRECATE=1  /D_CRT_NON_CONFORMING_SWPRINTFS=1 /D_SCL_SECURE_NO_WARNINGS=1  /D__NO_VC_CRTDBG__ /D__WXMSW__    /DNDEBUG     /D_UNICODE   /I..\..\lib\vc100_dll\mswu /I..\..\include  /W4  /DWXBUILDING /I..\..\src\tiff\libtiff /I..\..\src\jpeg /I..\..\src\png  /I..\..\src\zlib /I..\..\src\regex /I..\..\src\expat\lib /DwxUSE_GUI=0  /DWXMAKINGDLL_BASE /DwxUSE_BASE=1 /GR /EHsc  /Yu"wx/wxprec.h" /Fp"vc100_mswudll\wxprec_basedll.pch"   /Ycwx/wxprec.h ..\..\src\common\dummy.cpp
    dummy.cpp
    c:\users\lvu\temp\pip-build-w8m2p4v3\wxpython\ext\wxwidgets\include\wx\event.h(212) : fatal error C1001: An internal error has occurred in the compiler.
    (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c[0x7EC6029D:0x00000000]', line 183)
     To work around this problem, try simplifying or changing the program near the locations listed above.
    Please choose the Technical Support command on the Visual C++
     Help menu, or open the Technical Support help file for more information
    Internal Compiler Error in C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\cl.exe.  You will be prompted to send an error report to Microsoft later.

Could someone please at least share a copy of previous release binary built for Python 3.4, Windows, 32 bit? It's not in stapshot-builds anymore :( And no, I cannot update to Python 3.5/3.6, as py2exe only supports 3.4.

@ZanderBrown
Copy link

It would be a shame to drop 3.4 as that bars Debian & Raspbian users for using wxPython unless they use a custom build or back port

@NippurDeLagash
Copy link

Could someone please at least share a copy of previous release binary built for Python 3.4, Windows, 32 bit? It's not in stapshot-builds anymore :( And no, I cannot update to Python 3.5/3.6, as py2exe only supports 3.4.

Me too. I am stuck with Windows XP, and therefore with Python 3.4.x. I have a machine with Windows XP Professional and Visual Studio 2008 Express Edition. I could try to build a wxPython release, but I need guidance to do that.

@NippurDeLagash
Copy link

As I said last week, I wanted to try and build wxPython in this old XP machine with Visual Studio 2008 Express Edition and Python 3.4.4.

I had to install and add some extra tools like cygwin, doxygen, sip, and waf. In the end, dox, etg and sip were successfully built. I had to use the --nodoc option to avoid complains about missing GraphViz.

Then it was time to build the 'build' target, and I got the following error:

"Unable to find vcvarsall.bat"

I think this happens because Python 3.4.4 was built with Visual Studio 2010, and this machine has an older version (2008). I tweaked Python's distutils module to deliberately report the "right" version, and this way the build process continued for several minutes, until it stopped with the following error:

msvc: Impossible to find a valid architecture for building (in setup_msvc)

After that, I decided it was time to ask for help. Probably the next thing to do would be to install the correct compiler version. I did have an ISO image of Visual Studio 2010 Express Edition but unfortunately I trashed it, thinking I'd never need it again. This image is no longer downloadable from Microsoft, and I don't know where to find it.

Any suggestions?

Thanks!

Screen output of the last build follows...

E:\Phoenix>python build.py build

Will build using: "C:\Python34\python.exe"
3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)]
Python's architecture is 32bit
cfg.VERSION: 4.0.0a3

Running command: build
Running command: build_wx
MSVC: C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe
wxWidgets build options: ['--wxpython', '--unicode']
creating wx/msw/setup.h from setup0.h
setting build options...
nmake.exe -f makefile.vc UNICODE=1 OFFICIAL_BUILD=1 COMPILER_VERSION=90 SHARED=1
MONOLITHIC=0 USE_OPENGL=1 USE_GDIPLUS=1 BUILD=release

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

WARNING: msgfmt command not found, message catalogs not rebulit.
Please install gettext and associated tools.
Finished command: build_wx (0m13.970s)
Running command: build_py
Checking for E:\Phoenix\bin\waf-1.7.15-p1...
MSVC: C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe
"C:\Python34\python.exe" E:\Phoenix\bin\waf-1.7.15-p1 --msvc_arch=x86 --python="
C:\Python34\python.exe" --out=build/waf/3.4/x86/release configure build
Setting top to : E:\Phoenix
Setting out to : E:\Phoenix\build\waf\3.4\x86\release
Checking for program CL : C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\CL.exe
Checking for program CL : C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\CL.exe
Checking for program CL : C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\CL.exe
Checking for program CL : C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\CL.exe
Checking for program CL : C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\CL.exe
Checking for program CL : C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\CL.exe
msvc: Impossible to find a valid architecture for building (in setup_msvc)
(complete log in E:\Phoenix\build\waf\3.4\x86\release\config.log)
Command '"C:\Python34\python.exe" E:\Phoenix\bin\waf-1.7.15-p1 --msvc_arch=x86 --python="C:\Python34\python.exe" --out=build/waf/3.4/x86/release configure build' failed with exit code 1.
Finished command: build_py (0m11.426s)
Finished command: build (0m25.396s)

@lvu
Copy link
Contributor Author

lvu commented May 29, 2017

@NippurDeLagash I managed to build it with the compiler from MS Windows 7.1 SDK under a real WinXP. No need to use cygwin etc, if you build from distributed .tar.gz, as it has all that stuff already built in it. The main issue for me was that the SDK puts wrong data to registry, so that its own vcvarsall.bat cannot find the needed paths. So I made this .reg file, https://gist.github.com/lvu/516f1b2acc2dbf13638e8533f548e7cf, which adds the registry keys needed (but it will work only if you install the SDK to its default path). Then install wheel from PyPI and do python setup.py bdist_wheel.

Not sure if this is all that's needed, as I've spent some time on this and didn't document the whole process. If you have other issues, I'll try to recall if I know how to solve them.

@lvu lvu closed this as completed May 29, 2017
@lvu lvu reopened this May 29, 2017
@ZanderBrown
Copy link

sudo pip3 install wxpython --log indicates an internal compiler error.

@NippurDeLagash
Copy link

@IVU Thanks for your suggestions. I installed Windows SDK 7.1 but it did not help. I checked all registry entries against your .reg file. They are OK. The only difference is that your key names have a trailing v7.0A and mine have v7.1, but all their values match perfectly.

The only difference that matters is the value of the key
[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\SxS\VS7]
mine = "9.0"="C:\Program Files\Microsoft Visual Studio 9.0\"
yours = "10.0"="C:\Program Files\Microsoft Visual Studio 10.0\"

However, I added the last Visual Studio key value pretending I have Visual Studio 2010 installed, and now the build process complains about a missing windows.h include file. This file exists and is located under C:\Program Files\Microsoft SDKs\Windows\v7.1\Include.

Here is the error message:

cl /c /nologo /TC /Fovc100_mswudll\wxpng_png.obj /MD /DWIN32 /Zi /Fd....\lib\vc100_dll\wxpng.pdb /O2 /D_CRT_SECURE_NO_DEPRECATE=1 /D_CRT_NON_CONFORMING_SWPRINTFS=1 /D_SCL_SECURE_NO_WARNINGS=1 /D__NO_VC_CRTDBG__ /DNDEBUG /D_CRT_SECURE_NO_WARNINGS /I....\src\zlib ....\src\png\png.c png.c
e:\phoenix\ext\wxwidgets\src\png\pngpriv.h(373) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

@lvu
Copy link
Contributor Author

lvu commented May 30, 2017

@NippurDeLagash Have you tried adding all that .reg file to the registry?

@RobinD42
Copy link
Member

RobinD42 commented Jun 1, 2017

I had hoped that I would be able to get builds for 3.4 again almost for free by porting the code to use the Py_LIMITED_API (which in theory would allow one wxPython build to be used with all current Python 3.x releases, see #314, #371) but I ran into many little stumbling blocks with that and so it is on the back burner for now.

So I'll go ahead and turn on the buildbot builders for Python 3.4 again, but to save some time and resources I'll just do it for the snapshot/release builds, not for the builds triggered by commits.

@RobinD42
Copy link
Member

RobinD42 commented Jun 1, 2017

See 1d86e8b

@NippurDeLagash
Copy link

@RobinD42 thanks for restoring the 3.4 builder.

@IVU No and yes. (No) I did not double-click on your .reg file, but (yes) I manually (well, actually with the help of WinMerge) checked each single entry and made sure that: 1) all your keys were present in my registry, and 2) they had the same values. It may be possible that the wrong/missing registry entries you noticed with the SDK v7.0A where fixed when SDK v7.1 was released.

The good news today is that I found the .ISO image of VS2010 Express Edition, installed it, and this time the build completed. I also installed wheel from PyPI, created the .whl file, but it refuses to install. Error message follows:

E:\Phoenix\dist>pip3 install wxPython-4.0.0a3-cp34-cp34m-win32.whl
wxPython-4.0.0a3-cp34-cp34m-win32.whl is not a supported wheel on this platform.

However, installation works fine when running the script, i.e.

python build.py install

Here is the output of 'pip3 list' on my machine.

pip (7.1.2)
pywin32 (221)
setuptools (18.2)
wheel (0.29.0)
wxPython (4.0.0a3)

Question: is there a way to build the installation program (.exe file), like in wxPython 3 and earlier versions?

@RobinD42
Copy link
Member

RobinD42 commented Jun 1, 2017

I also installed wheel from PyPI, created the .whl file, but it refuses to install. Error message follows:

Did you use python build.py bdist_wheel or some other way?

Question: is there a way to build the installation program (.exe file), like in wxPython 3 and earlier versions?

No, the InnoSetup scripts and related stuff has been removed. But you may be able to use python build.py bdist_msi, if you edit build.py to re-enable the command (the cmd_bdist_msi function is currently commented out). It's been a long time since I tested it, but it did work at one point. It was commented out because it didn't work with a 4 component version number, but now that I've switched back to 3 components then it will probably work again. There's also bdist_wininst that will make a .exe, but I don't know if it works or not. The main disadvantage of these installer methods is that you have to jump through hoops to get them to work with virtual environments.

@NippurDeLagash
Copy link

Did you use python build.py bdist_wheel or some other way?

Yes, I used the build target bdist_wheel. It turned out that the problem was not the .WHL file, but that I was trying to install it with a wrong version of pip (it was too old). The cure was to upgrade pip from 7.1.2 to 9.0.1.

I also tried bdist_wininst and bdist_msi, and both of them work fine.

@IVU asked 11 days ago:

Could someone please at least share a copy of previous release binary built for Python 3.4, Windows, 32 bit?

Now we can answer "yes" to that question. Just tell me where I can upload the file.

@RobinD42
Copy link
Member

RobinD42 commented Jun 2, 2017

Could someone please at least share a copy of previous release binary built for Python 3.4, Windows, 32 bit?

Now we can answer "yes" to that question. Just tell me where I can upload the file.

I plan on doing the a3 release this weekend, so it may be a moot point now. However if something goes wrong with the release you can get the wheels to me (preferably both 32bit and 64bit) via a dropbox link or something and I can upload them to PyPI.

@NippurDeLagash
Copy link

You can download it from this link:

https://mega.nz/#!jldmmBTK!RoyJwyDPVC8lCY6A5URssUqf38Z2XjCNi6-6ZHF4ixQ

Only the 32-bit version, unfortunately. I looked at the build options, but did not find a way to create the 64-bit wheel under a 32-bit operating system with 32-bit Python installed. I have also a Windows 7, 64-bit machine, but with the "wrong" version of Python (2.7.12, 32-bit).

@RobinD42
Copy link
Member

RobinD42 commented Jun 5, 2017

3.4 builds are now on PyPI

@RobinD42 RobinD42 closed this as completed Jun 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants