I'm trying to install wxPython in VisualStudioCode but it is not working. I'll insert here code it gives me:
pip install wxPython==4.1.1
>>
Collecting wxPython==4.1.1
Using cached wxPython-4.1.1.tar.gz (66.0 MB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: pillow in c:\users\kamil\myenv\lib\site-packages (from wxPython==4.1.1) (9.4.0)
Requirement already satisfied: six in c:\users\kamil\myenv\lib\site-packages (from wxPython==4.1.1) (1.16.0)
Requirement already satisfied: numpy in c:\users\kamil\myenv\lib\site-packages (from wxPython==4.1.1) (1.24.2)
Installing collected packages: wxPython
DEPRECATION: wxPython is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
Running setup.py install for wxPython ... error
error: subprocess-exited-with-error
× Running setup.py install for wxPython did not run successfully.
│ exit code: 1
╰─> [43 lines of output]
C:\Users\kamil\myenv\Lib\site-packages\setuptools\dist.py:771: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
warnings.warn(
C:\Users\kamil\myenv\Lib\site-packages\setuptools\config\setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
C:\Users\kamil\myenv\Lib\site-packages\setuptools\dist.py:317: DistDeprecationWarning: use_2to3 is ignored.
warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
running install
C:\Users\kamil\myenv\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
Will build using: "C:\Users\kamil\myenv\Scripts\python.exe"
3.11.2 (tags/v3.11.2:878ead1, Feb 7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)]
Python's architecture is 64bit
cfg.VERSION: 4.1.1
Running command: build
Running command: build_wx
Command '"C:\Users\kamil\myenv\Scripts\python.exe" -c "import setuptools, 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:\Users\kamil\myenv\Lib\site-packages\setuptools\_distutils\msvc9compiler.py", line 403, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\kamil\myenv\Lib\site-packages\setuptools\_distutils\msvc9compiler.py", line 281, in query_vcvarsall
raise DistutilsPlatformError("Unable to find vcvarsall.bat")
distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat
Finished command: build_wx (0m3.681s)
Finished command: build (0m3.681s)
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\kamil\myenv\Scripts\python.exe" -u build.py build
Command '"C:\Users\kamil\myenv\Scripts\python.exe" -u build.py build' failed with 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.
(myenv) PS C:\Users\kamil> pip install Python
ERROR: Could not find a version that satisfies the requirement Python (from versions: none)
ERROR: No matching distribution found for Python
(myenv) PS C:\Users\kamil> pip install wxPython
Collecting wxPython
Using cached wxPython-4.2.0.tar.gz (71.0 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\kamil\AppData\Local\Temp\pip-install-xyqp1l_l\wxpython_2ac19af48cc24089ac12af82f2dc20f0\setup.py", line 27, in <module>
from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
File "C:\Users\kamil\AppData\Local\Temp\pip-install-xyqp1l_l\wxpython_2ac19af48cc24089ac12af82f2dc20f0\buildtools\config.py", line 30, in <module>
from attrdict import AttrDict
File "C:\Users\kamil\myenv\Lib\site-packages\attrdict\__init__.py", line 5, in <module>
from attrdict.mapping import AttrMap
File "C:\Users\kamil\myenv\Lib\site-packages\attrdict\mapping.py", line 4, in <module>
from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (C:\Users\kamil\AppData\Local\Programs\Python\Python311\Lib\collections\__init__.py)
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
I Also did pip install attrdict pip install wxPython==4.1.1
It is March of 2023 and I am here to seek help while I am trying to build an app. I use Chat GPT to help me.
I am looking for help online but it is hard to find something what would help real person to build something.
Wow it still says my post is mostly code and I need to add more details. This is very annoying right from the start. What's next?