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

WXPYTHON 4.2.0 REFUSED TO BUILD ON PYTHON 3.9 AND 3.10 #2235

Closed
baaziznasser opened this issue Aug 14, 2022 · 15 comments
Closed

WXPYTHON 4.2.0 REFUSED TO BUILD ON PYTHON 3.9 AND 3.10 #2235

baaziznasser opened this issue Aug 14, 2022 · 15 comments

Comments

@baaziznasser
Copy link

hello, i was using wxpython 4.1.1 on python 3.9,, i updated python to 3.10 and i wanted to update the wxpython also, i tried to install it using pip install wxpython
but always i get a building problem,
i tried to install vs 2022,community
and all the required packages are installed
here is the error

    File "C:\Users\nacer baaziz\AppData\Local\Temp\pip-install-7_5b8oll\wxpython_735dbcfdfa8e47b48b91adcf9cb4970f\bu

ildtools\build_wxwidgets.py", line 503, in main
exitIfError(wxBuilder.build(dir=buildDir, options=args), "Error building")
File "C:\Users\nacer baaziz\AppData\Local\Temp\pip-install-7_5b8oll\wxpython_735dbcfdfa8e47b48b91adcf9cb4970f\bu
ildtools\build_wxwidgets.py", line 72, in exitIfError
raise builder.BuildError(msg)
buildtools.builder.BuildError: Error building
Finished command: build_wx (0m23.666s)
Finished command: build (0m23.666s)
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:\Users\nacer baaziz\AppData\Local\Programs\Python\Python310-32\python.exe" -u build.py build                   
  Command '"C:\Users\nacer baaziz\AppData\Local\Programs\Python\Python310-32\python.exe" -u build.py build' failed w

ith exit code 1.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> wxpython

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

where is the problem please? and how i can fix it?<!-- For bugs or other problems please provide the following details in addition to
your issue report, if applicable. See also https://wxpython.org/pages/how-to-submit-issue/

 For issues about building on Linux, please read this page before reporting it here:
 https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/

-->

Operating system:
wxPython version & source:
Python version & source:

Description of the problem:

Code Example (click to expand)
# Put code sample here
@baaziznasser
Copy link
Author

am using windows10 21h2 x64
python 3.9 and 3.10 32bit
also i tried it on windows 11 and python 3.10

@swt2c
Copy link
Collaborator

swt2c commented Aug 16, 2022

It looks like @RobinD42 only build 64-bit wheels for Windows. Robin, any reason you didn't build 32-bit wheels?

@baaziznasser can you use 64-bit Python?

@baaziznasser
Copy link
Author

@swt2c i need a python 32 bit, because am making a software and need to compile it to an exe that work with all windows versions

@baaziznasser
Copy link
Author

@@RobinD42 there isn't a way to make it like the old one??? i mean 4.1.1 it was accept the installation without problem.
update that please

@codeofdusk
Copy link

@RobinD42 The lack of a 32-bit wheel is blocking the NVDA screen reader from updating to a recent, supported version of Python (we're stuck on 3.7).

@seanbudd
Copy link

I don't think that's true @codeofdusk, it would just be good to have a 32bit wheel so we can easily update to wxPython 4.2.0

@seanbudd
Copy link

Sorry, this is also blocking us from updating to Python 3.10, locking us at python 3.9 too

@josephsl
Copy link

Hi,

Is it because of distutils/setuptools/msi issue? I remember seeing something in a Git log for wxPython a while back. We (NVDA developers) would like to move to Python 3.10/3.11 as it includes updated libffi library that fixes a critical showstopper, and Python 3.7 will be end of life in 2023.

Thanks.

@josephsl
Copy link

Hi,

Managed to build a wheel for 32-bit Python 3.7 (tweaked instructions from https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/index.html):

Environment: Windows 11 2022 Update (Version 22H2 build 22623.741 beta), Python 3.7.9 32-bit, Visual Studio 2022 Community

  1. Install Visual Studio 2022 Community. For Python 3.7 support, try installing VS141/VS142 tools (I have VS142 tools installed for developing NVDA screen reader). You can skip this if you have VS2022 installed.
  2. From Command Prompt/PowerShell/Windows Terminal, run the following (press Enter after each command):

py -3.7 -m pip install --upgrade pip (you can skip this if pip is up to date)
py -3.7 -m pip install wheel (you need this to generate wheels)
py -3.7 -m pip install attrdict (without this dependency, wxPython's setup.py will fail)
py -3.7 -m pip download wxpython==4.2.0 (you don't have to specify version tag as 4.2.0 is the latest as of time of this comment)
py -3.7 -m pip wheel -v wxPython-4.2.0.tar.gz

In the last command, you can specify where to dump the wheel file (with Command Prompt running without admin privileges, default folder is %sysdrive%\Users{username}.

Compilation process:

  1. Visual Studio compiler (cl.exe) is run to compile C++ files.
  2. SIP is run to generate Python wrapper for C++ files.
  3. Data such as localization are processed.

The entire process takes at least fifteen minutes (I have an SSD with Intel 11th gen Core I7 processor inside a Lenovo ThinkPad laptop).

Thanks.

@josephsl
Copy link

Hi,

Turns out this issue may not be related to wxPython - it is attrdict that is the likely culprit, as it wants to import collections.Mapping which is gone in Python 3.9. My question then is why use attrdict which hasn't been updated since February 2019 - perhaps there might be an updated version that might not have been registered with Python Package Index.

Thanks.

@josephsl
Copy link

Hi,

Update: managed to build Python 3.11 32-bit wxPython wheel. Some extra steps must be performed in addition to the ones listed for Python 3.7:

  1. Install requests package from PYPI BEFORE downloading wxpython.
  2. After installing attrdict, open the attrdict directory (Python instal folder/lib/site-packages/attrdict), open Python files in there, then change "from collections import Mapping" to "from collections.abc import Mapping".

If people say yes and provided that I manage to build 32-bit wheels for Python 3.8, 3.9, and 3.10, I'm willing to host 32-bit wheels on a GitHub repository for the time being (for Python 3.7, I don't expect to build further 32-bit wheels as that Python release is in security releases only mode). I will remove 32-bit wheels if Robin asks.

Thanks.

@oleksis
Copy link
Contributor

oleksis commented Oct 11, 2022

Other option is use the workflows with Azure Pipelines and generate the artifacts

@josephsl
Copy link

josephsl commented Oct 11, 2022 via email

@swt2c
Copy link
Collaborator

swt2c commented Sep 12, 2024

32-bit wheels are available with 4.2.2.

@swt2c swt2c closed this as completed Sep 12, 2024
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

6 participants