-
Notifications
You must be signed in to change notification settings - Fork 516
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
error in installing wxPython on windows #2024
Comments
Hi, unfortunately, wxPython 4.1.1 doesn't build on Python 3.10 on Windows currently, see #2016. That needs to be fixed first. As a workaround you could try Python 3.9 for now. |
Best I can tell, this issue is not Python 3.10-specific. It rears its ugly head anytime a modern version of Visual Studio is installed in lieu of MSVC 2015 or something older (shudder). |
Well, there's definitely a Python 3.10 issue on Windows. If the OP wants to provide more details, we could investigate. However, this error is coming from distutils, so there's not likely anything we can do about it in wxPython. |
Hi @rkadam61001 I think the issue is You can check more in the gist: Compile wxPython 4.1.2a1 using Microsoft C++ Build Tools 2019 |
I have the same issue with wxPython, Python 3.10 and Visual Studio 2019. Will this be fixed on wxPython's side? I imagine many more wxPython users on Windows are affected... |
Had Python 3.10.1 installed with VS2022 and 2019 build tools installed and configured properly. Couldn't build the wxpython whl that was generated/downloded by running "pip install wxpython". Reading through the previous answers, rolled back my Python version to 3.9.9. Then was able to install through the same pip command successfully. So indeed it looks like a Python 3.10 problem. |
For Python 3.10 and wxPython 4.1.2a1 I recommend that you clone the git repository and submodules from GitHub Have VS2022 and 2019 Build Tools and following this comment compiles successfully python -c "import wx; print(wx.version());"
4.1.2a1 msw (phoenix) wxWidgets 3.1.5 |
I want to have someone run some tests for me with a script I wrote. It creates an identical build environment that Visual C and Visual Studio creates. It doe this without using the vcvars*.bat files that come with Visual C and Visual Studio. Those files have never really worked properly and have been proven to be problematic at best and I do not understand why distutils and also setuptools continually uses them. run the msvc.py file then copy and paste the output into a post. Let me know the Visual Studio version, Windows SDK, MSVC build tools version you have installed and I will check the output to make sure it is correct. If someone wants to test it to see if it fixes the compiling problems you can drop those 2 files into the same folder as the setup.py file for wxPython and then edit setup.py file and add this one single line at the top |
issue solved |
It looks very interesting and returns a lot of information about the environment!
Hire how i tested: python -m pip install --upgrade pip setuptools wheel
virtualenv venv
.\venv\Scripts\activate
pip install comtypes
python .\msvc.py |
The information it is telling you is not just information for informative purposes that information that is collected is what gets used to create the build environment. By adding the import of the module to the top of the setup.py file for wxPython the script will load and set the build environment. Give it a try and compile wxPython with it. Yes that is a link to the repository for it. I just pushed a commit to it a few hours ago. The nice thing about what I have done is I am using COM interfaces to collect a large portion of the information from the system. I technically have it incorrectly named as I thought the COM interfaces where made available by vswhere but as it turns out vswhere uses the same com interfaces to work just like what I am doing. I have exposed a whole lot more information then what vswhere provides. Right now if you have more then one version of visual c installed you can tel the program what compiler to use, you can also specify an SDK to use if you have more then one installed. UCRT comes pre installed into the Windows 10SDK's so if you wanted to compile something that uses UCRT except say you wanted to use the Windows 7 SDK you would install a Windows 10 SDK along side the Windows 7 SDK and the script will use the UCRT headers and libs from the Windows 10 SDK. I will also be adding support for specifying which toolkit to compile with and the .NET framework as well. To handle most compiling needs just add the 2 files and import msvc at the top of the setup.py file. Do you mind posting a copy of the output from the script? I would like to make sure all is correct with it and if any adjustments need to be made I will make them. |
@kdschlosser Here the active issue We could adapt |
easily. Just import msvc at the top of build.py |
I am also having issues. Here is the log. I am not very python-savvy; but am willing to help anyone debug this issue. Would love to get this up and running as I need to develop an GUI based python code soon and would need this resolved × Running setup.py install for wxPython did not run successfully.
note: This error originates from a subprocess, and is likely not a problem with pip. |
Try apply the PR #2085 or use the msvc-build-environment branch |
Or, if you don't actually care about building wxPython yourself, you could install one of the snapshot builds for Python 3.10: wxPython 4.1.1 can't be built for Python 3.10 without applying additional fixes on top. |
Couldn't install on Window 11 & Python 3.10.4. Downgraded to 3.9.12 worked |
after downgrading my python version from 3.10 to 3.9. wxpython installing success but at the end i had an error "setup.py install for wxpython ... error". How to solve this? |
Read this comment for install wxPython on Windows |
Can you please tell me the steps to solve the Issue |
Collecting wxPython
Using cached wxPython-4.1.1.tar.gz (66.0 MB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: pillow in c:\python\lib\site-packages (from wxPython) (8.4.0)
Requirement already satisfied: six in c:\python\lib\site-packages (from wxPython) (1.16.0)
Requirement already satisfied: numpy in c:\python\lib\site-packages (from wxPython) (1.21.4)
Using legacy 'setup.py install' for wxPython, since package 'wheel' is not installed.
Installing collected packages: wxPython
Running setup.py install for wxPython ... error
ERROR: Command errored out with exit status 1:
command: 'C:\python\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\HP\AppData\Local\Temp\pip-install-72by_mwf\wxpython_a8f2bd6de2d945b69743e5fd61117a3b\setup.py'"'"'; file='"'"'C:\Users\HP\AppData\Local\Temp\pip-install-72by_mwf\wxpython_a8f2bd6de2d945b69743e5fd61117a3b\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\HP\AppData\Local\Temp\pip-record-pmvep6e2\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\python\Include\wxPython'
cwd: C:\Users\HP\AppData\Local\Temp\pip-install-72by_mwf\wxpython_a8f2bd6de2d945b69743e5fd61117a3b
Complete output (49 lines):
C:\python\lib\site-packages\setuptools\dist.py:697: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
warnings.warn(
running install
running build
C:\Users\HP\AppData\Local\Temp\pip-install-72by_mwf\wxpython_a8f2bd6de2d945b69743e5fd61117a3b\build.py:41: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
from distutils.dep_util import newer, newer_group
Will build using: "C:\python\python.exe"
3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)]
Python's architecture is 64bit
cfg.VERSION: 4.1.1
ERROR: Command errored out with exit status 1: 'C:\python\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\HP\AppData\Local\Temp\pip-install-72by_mwf\wxpython_a8f2bd6de2d945b69743e5fd61117a3b\setup.py'"'"'; file='"'"'C:\Users\HP\AppData\Local\Temp\pip-install-72by_mwf\wxpython_a8f2bd6de2d945b69743e5fd61117a3b\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\HP\AppData\Local\Temp\pip-record-pmvep6e2\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\python\Include\wxPython' Check the logs for full command output.
The text was updated successfully, but these errors were encountered: