wxWidgets / Phoenix

wxPython's Project Phoenix. A new implementation of wxPython, better, stronger, faster than he was before.
http://wxpython.org/
2.23k stars 510 forks source link

Pip install of wxPython 4.2.0 fails with python 3.11 #2296

Closed zanseb closed 1 year ago

zanseb commented 1 year ago

Operating system: Windows 11 21h2 wxPython version & source: 4.2.0, pip Python version & source: 3.11, stock

Description of the problem: It is possible to download wxPython 4.2.0 with python 3.11, but the installation fails with the following error.

Collecting attrdict3==2.0.2
  Downloading attrdict3-2.0.2-py2.py3-none-any.whl (10 kB)
Collecting wxPython==4.2.0
  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
  ╰─> [8 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\sebastian.zanoni\AppData\Local\Temp\pip-install-r3muw0vn\wxpython_5c9d35d3ceba4024bd3688fcf9f73870\setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "C:\Users\sebastian.zanoni\AppData\Local\Temp\pip-install-r3muw0vn\wxpython_5c9d35d3ceba4024bd3688fcf9f73870\buildtools\config.py", line 30, in <module>
          from attrdict import AttrDict
      ModuleNotFoundError: No module named 'attrdict'
      [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.

I tried with both package attrdict and attrdict3 Everything works as expected with py310, even w/o the attrdict package.

swt2c commented 1 year ago

Did you install attrdict3 before trying to install wxPython? Unfortunately, that needs to happen.

zanseb commented 1 year ago

I installed attrdict3 via pip right before installing wxPython. You can see it in the output above. Is there maybe a specific way to install it or is pip install sufficient?

swt2c commented 1 year ago

Looking at the log above, it looks like you installed it as part of the same transaction...

zanseb commented 1 year ago

Correct, it is part of the requirements.txt which is installed all at once with pip. Do you think I need to install it seperately?

swt2c commented 1 year ago

Correct, it is part of the requirements.txt which is installed all at once with pip. Do you think I need to install it seperately?

Yes.

zanseb commented 1 year ago

Thanks, I tried it and it got a step further. Unfortunately i get following error while compiling the package

  × Running setup.py install for wxPython did not run successfully.
  │ exit code: 1
  ╰─> [63 lines of output]
      C:\Users\sebastian.zanoni\.virtualenvs\311\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\sebastian.zanoni\.virtualenvs\311\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\sebastian.zanoni\.virtualenvs\311\Lib\site-packages\setuptools\dist.py:317: DistDeprecationWarning: use_2to3 is ignored.
        warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
      running install
      C:\Users\sebastian.zanoni\.virtualenvs\311\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\sebastian.zanoni\.virtualenvs\311\Scripts\python.exe"
      3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)]
      Python's architecture is 64bit
      cfg.VERSION: 4.2.0

      Running command: build
      Running command: build_wx
      CL.exe: C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64\cl.exe
      Downloading microsoft.web.webview2 1.0.1185.39...
      Connection successful...
      Data downloaded...
      wxWidgets build options: ['--wxpython', '--unicode']
      Updating wx/msw/setup.h
      setting build options...
      nmake.exe -f makefile.vc UNICODE=1 OFFICIAL_BUILD=1 COMPILER_VERSION=140 SHARED=1 MONOLITHIC=0 USE_OPENGL=1 USE_GDIPLUS=1 BUILD=release

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

          if not exist vc140_x64_mswudll mkdir vc140_x64_mswudll
          if not exist ..\..\lib\vc140_x64_dll mkdir ..\..\lib\vc140_x64_dll
          if not exist ..\..\lib\vc140_x64_dll\mswu mkdir ..\..\lib\vc140_x64_dll\mswu
          if not exist ..\..\lib\vc140_x64_dll\mswu\wx mkdir ..\..\lib\vc140_x64_dll\mswu\wx
          if not exist ..\..\lib\vc140_x64_dll\mswu\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\vc140_x64_dll\mswu\wx\setup.h
              1 file(s) copied.
          if not exist ..\..\lib\vc140_x64_dll\mswu\wx\msw mkdir ..\..\lib\vc140_x64_dll\mswu\wx\msw
          cl /EP /nologo  "..\..\include\wx\msw\genrcdefs.h" > "..\..\lib\vc140_x64_dll\mswu\wx\msw\rcdefs.h"
      genrcdefs.h
          cl /c /nologo /TC /Fovc140_x64_mswudll\wxregex_pcre2_auto_possess.obj /MD /DWIN32  /Zi /Fd..\..\lib\vc140_x64_dll\wxregexu.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..\..\include /I..\..\lib\vc140_x64_dll\mswu  /I..\..\3rdparty\pcre\src\wx /D__WX__ /DHAVE_CONFIG_H /D_UNICODE    ..\..\3rdparty\pcre\src\pcre2_auto_possess.c
      pcre2_auto_possess.c
      C:\Users\sebastian.zanoni\AppData\Local\Temp\pip-install-cegcsy52\wxpython_8e836178d56747d496ae073d0bfca6de\ext\wxWidgets\include\wx/chartype.h(105): fatal error C1083: Cannot open include file: 'tchar.h': No such file or directory
      NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\bin\HostX64\x64\cl.EXE"' : return code '0x2'
      Stop.
      Error building
      ERROR: failed building wxWidgets
      Traceback (most recent call last):
        File "C:\Users\sebastian.zanoni\AppData\Local\Temp\pip-install-cegcsy52\wxpython_8e836178d56747d496ae073d0bfca6de\build.py", line 1563, in cmd_build_wx
          wxbuild.main(wxDir(), build_options)
        File "C:\Users\sebastian.zanoni\AppData\Local\Temp\pip-install-cegcsy52\wxpython_8e836178d56747d496ae073d0bfca6de\buildtools\build_wxwidgets.py", line 503, in main
          exitIfError(wxBuilder.build(dir=buildDir, options=args), "Error building")
        File "C:\Users\sebastian.zanoni\AppData\Local\Temp\pip-install-cegcsy52\wxpython_8e836178d56747d496ae073d0bfca6de\buildtools\build_wxwidgets.py", line 72, in exitIfError
          raise builder.BuildError(msg)
      buildtools.builder.BuildError: Error building
      Finished command: build_wx (0m1.984s)
      Finished command: build (0m1.984s)
      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\sebastian.zanoni\.virtualenvs\311\Scripts\python.exe" -u build.py build
      Command '"C:\Users\sebastian.zanoni\.virtualenvs\311\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

Somehow it doen't find tchar.h -> Cannot open include file: 'tchar.h': No such file or directory

swt2c commented 1 year ago

Not sure about that. Do you have C++ support installed with Visual Studio?

zanseb commented 1 year ago

Yes, wxpython with python 3.10 works fine on the same machine. Could the reason be that there is a wheel file of this package for python310 but not for python311? Meaning that I do not actually compile wxPython for py310?

swt2c commented 1 year ago

Yes, wxpython with python 3.10 works fine on the same machine. Could the reason be that there is a wheel file of this package for python310 but not for python311? Meaning that I do not actually compile wxPython for py310?

Indeed. If you installed the wheel for Python 3.10, then you did not compile it yourself.

pratik139patel commented 1 year ago

So how can we resolve this issue? Can you guide me how to compile wxPython for 3.11?

zanseb commented 1 year ago

FWIW, I have done a little more research and the main reason the build is failing (at least for my setup) is that the include paths are not resolved correctly. tchar.h can be found on my system at C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt, however when executing following build step https://github.com/wxWidgets/Phoenix/blob/3ee614e0e8cd5ed603b6a07f4e5ab846ca9de036/buildtools/config.py#L997-L1006 the above mentioned path is not found.

I don't know whether the build is supposed to work with win11 and VS2022, therefore I guess I'll wait for the offical wheels, thanks for your help!

Let me know if you want to do further investigation, I'll be happy to help. Thanks again.

vlandau commented 1 year ago

This same thing is happening to me in Python 3.10 in docker. To reproduce:

Enter the Ubunutu-based Python 3.10 docker container

docker run -it python3.10 bash

Then run pip install wxPython==4.2.0 in the container to get the error:

⟩ docker run -it python:3.10 bash
root@bb96d10e2c88:/# pip install wxPython==4.2.0
Collecting wxPython==4.2.0
  Downloading wxPython-4.2.0.tar.gz (71.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 71.0/71.0 MB 9.8 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-x50rr2yc/wxpython_8d81c8b381de4bab88b403313cd92605/setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "/tmp/pip-install-x50rr2yc/wxpython_8d81c8b381de4bab88b403313cd92605/buildtools/config.py", line 30, in <module>
          from attrdict import AttrDict
      ModuleNotFoundError: No module named 'attrdict'
      [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.

[notice] A new release of pip available: 22.2.2 -> 22.3
[notice] To update, run: pip install --upgrade pip

It seems that attrdict3 needs to be installed for wxPython to successfully installed regardless of OS, but attrdict3 is only required when the host OS is windows: https://github.com/wxWidgets/Phoenix/blob/master/requirements/devel.txt#L24

swt2c commented 1 year ago

Yes @vlandau I addressed that here: 2e9169effa9abf14f34f8436a791b8829eea7774

vlandau commented 1 year ago

@swt2c, thanks for the quick response! Is that change not reflected in 4.2.0? I appears that attrdict3 wasn't made a requirement for the package in the latest version. I very well could be missing something, though.

swt2c commented 1 year ago

@swt2c, thanks for the quick response! Is that change not reflected in 4.2.0? I appears that attrdict3 wasn't made a requirement for the package in the latest version. I very well could be missing something, though.

No, that change was made post-4.2.0.

vlandau commented 1 year ago

Okay sounds good! I assume it'll be in the next patch release? Thanks again!

RobinD42 commented 1 year ago

This issue has been mentioned on Discuss wxPython. There might be relevant details there:

https://discuss.wxpython.org/t/wxpython-install-issue-on-macos-11-6-with-pyenv-and-python-3-11-0/36203/1

RobinD42 commented 1 year ago

This issue has been mentioned on Discuss wxPython. There might be relevant details there:

https://discuss.wxpython.org/t/is-wxpython-compatible-with-python-3-11-0-on-windows-10/36211/2

zanseb commented 1 year ago

@RobinD42, are you planning to build and publish the wheels for python 3.11?

swt2c commented 1 year ago

There will have to be a new release for supporting python 3.11.

C-BERBER commented 1 year ago

I too am having this problem after upgrading the os.. and I installed the packages separately before running the build. Any advice here would be appreciated since I can't run any of my wx code

(base) chrisb@GX701GXR:~$ pip3 install attrdict Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: attrdict in /usr/local/lib/python3.10/dist-packages (2.0.1) Requirement already satisfied: six in /usr/lib/python3/dist-packages (from attrdict) (1.16.0) (base) chrisb@GX701GXR:~$ sudo pip3 install wxpython [sudo] password for chrisb: 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 "", line 2, in File "", line 34, in File "/tmp/pip-install-6cudl9pt/wxpython_7b0d83780ca349b0bdca9095067195dd/setup.py", line 27, in from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName File "/tmp/pip-install-6cudl9pt/wxpython_7b0d83780ca349b0bdca9095067195dd/buildtools/config.py", line 30, in from attrdict import AttrDict File "/usr/local/lib/python3.10/dist-packages/attrdict/init.py", line 5, in from attrdict.mapping import AttrMap File "/usr/local/lib/python3.10/dist-packages/attrdict/mapping.py", line 4, in from collections import Mapping ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/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.

swt2c commented 1 year ago

On Fri, 11 Nov 2022, Chris Berberich wrote:

I too am having this problem after upgrading the os.. and I installed the packages separately before running the build. Any advice here would be appreciated since I can't run any of my wx code

(base) @.***:$ pip3 install attrdict

You need attrdict3 not attrdict.

Scott

TheQuinbox commented 1 year ago

I'm having this too. I did:

pip install attrdict3
pip install wxpython

And got: Collecting wxpython Using cached wxPython-4.2.0.tar.gz (71.0 MB) Preparing metadata (setup.py) ... done Building wheels for collected packages: wxpython Building wheel for wxpython (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [42 lines of output] running bdist_wheel running build Will build using: "C:\Users\Owner\code\python\mastoquin\env\Scripts\python.exe" 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] Python's architecture is 64bit cfg.VERSION: 4.2.0

  Running command: build
  Running command: build_wx
  CL.exe: NOT FOUND
  Downloading microsoft.web.webview2 1.0.1185.39...
  Connection successful...
  Data downloaded...
  wxWidgets build options: ['--wxpython', '--unicode']
  Updating wx/msw/setup.h
  setting build options...
  Error building
  ERROR: failed building wxWidgets
  Traceback (most recent call last):
    File "C:\Users\Owner\AppData\Local\Temp\pip-install-xigqu8_5\wxpython_8546a1d74e59430585cf41deaa2aeff1\build.py", line 1563, in cmd_build_wx
      wxbuild.main(wxDir(), build_options)
    File "C:\Users\Owner\AppData\Local\Temp\pip-install-xigqu8_5\wxpython_8546a1d74e59430585cf41deaa2aeff1\buildtools\build_wxwidgets.py", line 503, in main
      exitIfError(wxBuilder.build(dir=buildDir, options=args), "Error building")
    File "C:\Users\Owner\AppData\Local\Temp\pip-install-xigqu8_5\wxpython_8546a1d74e59430585cf41deaa2aeff1\buildtools\build_wxwidgets.py", line 72, in exitIfError
      raise builder.BuildError(msg)
  buildtools.builder.BuildError: Error building
  Finished command: build_wx (0m4.67s)
  Finished command: build (0m4.67s)
  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\Owner\code\python\mastoquin\env\Scripts\python.exe" -u build.py build
  Command '"C:\Users\Owner\code\python\mastoquin\env\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: Failed building wheel for wxpython Setup.py fails in a similar way. no idea why its saying cl.exe isn't found, as I have MSVC installed (I just installed and built Rust like 2 days ago). Any ideas?

GabrieleBattaglia commented 1 year ago

I ve the same. Both under Win11, Python 3.11 and Ubuntu via WSL2, python 3.8.10 None of two got success.

zanseb commented 1 year ago

@swt2c, I have seen that you are already building the wheel for py311 (https://alldunn.visualstudio.com/wxPython-CI/_build/results?buildId=1061&view=logs&j=1673e16c-f486-5fbe-9e06-af58c9e250b7). Do you have the possibility to upload it to the snapshot builds?

foozzi commented 1 year ago

same issue Fedora 36 Python 3.10.8

[fz0x1@fedora ~]$ pip3 install -v --user wxPython
Using pip 22.3.1 from /home/fz0x1/.local/lib/python3.10/site-packages/pip (python 3.10)
Collecting wxPython
  Using cached wxPython-4.2.0.tar.gz (71.0 MB)
  Running command python setup.py egg_info
  /usr/lib/python3.10/site-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
    warnings.warn(
  /usr/lib/python3.10/site-packages/setuptools/dist.py:300: DistDeprecationWarning: use_2to3 is ignored.
    warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
  running egg_info
  creating /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info
  writing /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/dependency_links.txt
  writing entry points to /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/entry_points.txt
  writing requirements to /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/requires.txt
  writing top-level names to /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'docs/sphinx/build'
  warning: no previously-included files matching '.git' found under directory 'wx'
  warning: no previously-included files matching '*.pyc' found under directory 'wx'
  warning: no previously-included files matching '__pycache__' found under directory 'wx'
  adding license file 'LICENSE.txt'
  writing manifest file '/tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/SOURCES.txt'
  Preparing metadata (setup.py) ... done
Collecting pillow
  Downloading Pillow-9.3.0-cp310-cp310-manylinux_2_28_x86_64.whl (3.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 7.1 MB/s eta 0:00:00
Requirement already satisfied: six in /usr/lib/python3.10/site-packages (from wxPython) (1.16.0)
Collecting numpy
  Downloading numpy-1.23.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.1/17.1 MB 19.7 MB/s eta 0:00:00
Installing collected packages: pillow, numpy, wxPython
  changing mode of /home/fz0x1/.local/bin/f2py to 755
  changing mode of /home/fz0x1/.local/bin/f2py3 to 755
  changing mode of /home/fz0x1/.local/bin/f2py3.10 to 755
  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 command Running setup.py install for wxPython
  /usr/lib/python3.10/site-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
    warnings.warn(
  /usr/lib/python3.10/site-packages/setuptools/dist.py:300: DistDeprecationWarning: use_2to3 is ignored.
    warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
  running install
  /usr/lib/python3.10/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
  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.

  "/usr/bin/python3" -u build.py build
  /tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/build.py:43: 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: "/usr/bin/python3"
  3.10.8 (main, Nov 14 2022, 00:00:00) [GCC 12.2.1 20220819 (Red Hat 12.2.1-2)]
  Python's architecture is 64bit
  cfg.VERSION: 4.2.0

  Running command: build
  Running command: build_wx
  wxWidgets build options: ['--wxpython', '--unicode', '--gtk3']
  Configure options: ['--enable-unicode', '--with-gtk=3', '--enable-sound', '--enable-graphics_ctx', '--enable-display', '--enable-geometry', '--enable-debug_flag', '--enable-optimise', '--disable-debugreport', '--enable-uiactionsim', '--enable-autoidman', '--with-sdl']
  /tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/ext/wxWidgets/configure --enable-unicode --with-gtk=3 --enable-sound --enable-graphics_ctx --enable-display --enable-geometry --enable-debug_flag --enable-optimise --disable-debugreport --enable-uiactionsim --enable-autoidman --with-sdl
  checking build system type... x86_64-pc-linux-gnu
  checking host system type... x86_64-pc-linux-gnu
  checking for toolkit... gtk
  checking for gcc... gcc
  checking whether the C compiler works... yes
  checking for C compiler default output file name... a.out
  checking for suffix of executables...
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C compiler... yes
  checking whether gcc accepts -g... yes
  checking for gcc option to accept ISO C89... none needed
  checking whether we are using the Intel C compiler... no
  checking how to run the C preprocessor... gcc -E
  checking for grep that handles long lines and -e... /usr/bin/grep
  checking for egrep... /usr/bin/grep -E
  checking whether gcc needs -traditional... no
  checking for g++... no
  checking for c++... no
  checking for gpp... no
  checking for aCC... no
  checking for CC... no
  checking for cxx... no
  checking for cc++... no
  checking for cl.exe... no
  checking for FCC... no
  checking for KCC... no
  checking for RCC... no
  checking for xlC_r... no
  checking for xlC... no
  checking whether we are using the GNU C++ compiler... no
  checking whether g++ accepts -g... no
  checking whether we are using the Intel C++ compiler... no
  checking whether we are using the Sun C++ compiler... no
  configure: error: C++ compiler is needed to build wxWidgets
  Error running configure
  ERROR: failed building wxWidgets
  Traceback (most recent call last):
    File "/tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/build.py", line 1563, in cmd_build_wx
      wxbuild.main(wxDir(), build_options)
    File "/tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/buildtools/build_wxwidgets.py", line 379, in main
      exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts),
    File "/tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/buildtools/build_wxwidgets.py", line 72, in exitIfError
      raise builder.BuildError(msg)
  buildtools.builder.BuildError: Error running configure
  Finished command: build_wx (0.633s)
  Finished command: build (0.633s)
  Command '"/usr/bin/python3" -u build.py build' failed with exit code 1.
  error: subprocess-exited-with-error

  × Running setup.py install for wxPython did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/bin/python3 -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize

  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)

  __file__ = %r
  sys.argv[0] = __file__

  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"

  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'/tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' install --record /tmp/pip-record-u35w_w1i/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/fz0x1/.local/include/python3.10/wxPython
  cwd: /tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/
  Running setup.py install for wxPython ... error
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.
foozzi commented 1 year ago

same issue Fedora 36 Python 3.10.8

[fz0x1@fedora ~]$ pip3 install -v --user wxPython
Using pip 22.3.1 from /home/fz0x1/.local/lib/python3.10/site-packages/pip (python 3.10)
Collecting wxPython
  Using cached wxPython-4.2.0.tar.gz (71.0 MB)
  Running command python setup.py egg_info
  /usr/lib/python3.10/site-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
    warnings.warn(
  /usr/lib/python3.10/site-packages/setuptools/dist.py:300: DistDeprecationWarning: use_2to3 is ignored.
    warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
  running egg_info
  creating /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info
  writing /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/dependency_links.txt
  writing entry points to /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/entry_points.txt
  writing requirements to /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/requires.txt
  writing top-level names to /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'docs/sphinx/build'
  warning: no previously-included files matching '.git' found under directory 'wx'
  warning: no previously-included files matching '*.pyc' found under directory 'wx'
  warning: no previously-included files matching '__pycache__' found under directory 'wx'
  adding license file 'LICENSE.txt'
  writing manifest file '/tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/SOURCES.txt'
  Preparing metadata (setup.py) ... done
Collecting pillow
  Downloading Pillow-9.3.0-cp310-cp310-manylinux_2_28_x86_64.whl (3.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 7.1 MB/s eta 0:00:00
Requirement already satisfied: six in /usr/lib/python3.10/site-packages (from wxPython) (1.16.0)
Collecting numpy
  Downloading numpy-1.23.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.1/17.1 MB 19.7 MB/s eta 0:00:00
Installing collected packages: pillow, numpy, wxPython
  changing mode of /home/fz0x1/.local/bin/f2py to 755
  changing mode of /home/fz0x1/.local/bin/f2py3 to 755
  changing mode of /home/fz0x1/.local/bin/f2py3.10 to 755
  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 command Running setup.py install for wxPython
  /usr/lib/python3.10/site-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
    warnings.warn(
  /usr/lib/python3.10/site-packages/setuptools/dist.py:300: DistDeprecationWarning: use_2to3 is ignored.
    warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
  running install
  /usr/lib/python3.10/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
  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.

  "/usr/bin/python3" -u build.py build
  /tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/build.py:43: 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: "/usr/bin/python3"
  3.10.8 (main, Nov 14 2022, 00:00:00) [GCC 12.2.1 20220819 (Red Hat 12.2.1-2)]
  Python's architecture is 64bit
  cfg.VERSION: 4.2.0

  Running command: build
  Running command: build_wx
  wxWidgets build options: ['--wxpython', '--unicode', '--gtk3']
  Configure options: ['--enable-unicode', '--with-gtk=3', '--enable-sound', '--enable-graphics_ctx', '--enable-display', '--enable-geometry', '--enable-debug_flag', '--enable-optimise', '--disable-debugreport', '--enable-uiactionsim', '--enable-autoidman', '--with-sdl']
  /tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/ext/wxWidgets/configure --enable-unicode --with-gtk=3 --enable-sound --enable-graphics_ctx --enable-display --enable-geometry --enable-debug_flag --enable-optimise --disable-debugreport --enable-uiactionsim --enable-autoidman --with-sdl
  checking build system type... x86_64-pc-linux-gnu
  checking host system type... x86_64-pc-linux-gnu
  checking for toolkit... gtk
  checking for gcc... gcc
  checking whether the C compiler works... yes
  checking for C compiler default output file name... a.out
  checking for suffix of executables...
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C compiler... yes
  checking whether gcc accepts -g... yes
  checking for gcc option to accept ISO C89... none needed
  checking whether we are using the Intel C compiler... no
  checking how to run the C preprocessor... gcc -E
  checking for grep that handles long lines and -e... /usr/bin/grep
  checking for egrep... /usr/bin/grep -E
  checking whether gcc needs -traditional... no
  checking for g++... no
  checking for c++... no
  checking for gpp... no
  checking for aCC... no
  checking for CC... no
  checking for cxx... no
  checking for cc++... no
  checking for cl.exe... no
  checking for FCC... no
  checking for KCC... no
  checking for RCC... no
  checking for xlC_r... no
  checking for xlC... no
  checking whether we are using the GNU C++ compiler... no
  checking whether g++ accepts -g... no
  checking whether we are using the Intel C++ compiler... no
  checking whether we are using the Sun C++ compiler... no
  configure: error: C++ compiler is needed to build wxWidgets
  Error running configure
  ERROR: failed building wxWidgets
  Traceback (most recent call last):
    File "/tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/build.py", line 1563, in cmd_build_wx
      wxbuild.main(wxDir(), build_options)
    File "/tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/buildtools/build_wxwidgets.py", line 379, in main
      exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts),
    File "/tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/buildtools/build_wxwidgets.py", line 72, in exitIfError
      raise builder.BuildError(msg)
  buildtools.builder.BuildError: Error running configure
  Finished command: build_wx (0.633s)
  Finished command: build (0.633s)
  Command '"/usr/bin/python3" -u build.py build' failed with exit code 1.
  error: subprocess-exited-with-error

  × Running setup.py install for wxPython did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/bin/python3 -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize

  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)

  __file__ = %r
  sys.argv[0] = __file__

  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"

  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'/tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' install --record /tmp/pip-record-u35w_w1i/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/fz0x1/.local/include/python3.10/wxPython
  cwd: /tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/
  Running setup.py install for wxPython ... error
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.

solved by installing clang

fenchu commented 1 year ago

I get to collections:

(base) root@ae2da1f1de9e:/# 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 "/tmp/pip-install-tlo1lok2/wxpython_0d517e7c72ba4491915e2ab43840cb26/setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "/tmp/pip-install-tlo1lok2/wxpython_0d517e7c72ba4491915e2ab43840cb26/buildtools/config.py", line 30, in <module>
          from attrdict import AttrDict
        File "/root/.pyenv/versions/3.11.0/envs/base/lib/python3.11/site-packages/attrdict/__init__.py", line 5, in <module>
          from attrdict.mapping import AttrMap
        File "/root/.pyenv/versions/3.11.0/envs/base/lib/python3.11/site-packages/attrdict/mapping.py", line 4, in <module>
          from collections import Mapping
      ImportError: cannot import name 'Mapping' from 'collections' (/root/.pyenv/versions/3.11.0/lib/python3.11/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 use pyenv, no idea how to switch to clang compilers with pyenv, it might be possible, but I then need to force everything under clang.

GabrieleBattaglia commented 1 year ago

[# Gabry B:] Ok, any fix for this? Any plans in action, to solve?

foozzi commented 1 year ago

I get to collections:

(base) root@ae2da1f1de9e:/# 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 "/tmp/pip-install-tlo1lok2/wxpython_0d517e7c72ba4491915e2ab43840cb26/setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "/tmp/pip-install-tlo1lok2/wxpython_0d517e7c72ba4491915e2ab43840cb26/buildtools/config.py", line 30, in <module>
          from attrdict import AttrDict
        File "/root/.pyenv/versions/3.11.0/envs/base/lib/python3.11/site-packages/attrdict/__init__.py", line 5, in <module>
          from attrdict.mapping import AttrMap
        File "/root/.pyenv/versions/3.11.0/envs/base/lib/python3.11/site-packages/attrdict/mapping.py", line 4, in <module>
          from collections import Mapping
      ImportError: cannot import name 'Mapping' from 'collections' (/root/.pyenv/versions/3.11.0/lib/python3.11/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 use pyenv, no idea how to switch to clang compilers with pyenv, it might be possible, but I then need to force everything under clang.

you are install 'attrdict' whereas you should to install 'attrdict3'

foozzi commented 1 year ago

I get to collections:

(base) root@ae2da1f1de9e:/# 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 "/tmp/pip-install-tlo1lok2/wxpython_0d517e7c72ba4491915e2ab43840cb26/setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "/tmp/pip-install-tlo1lok2/wxpython_0d517e7c72ba4491915e2ab43840cb26/buildtools/config.py", line 30, in <module>
          from attrdict import AttrDict
        File "/root/.pyenv/versions/3.11.0/envs/base/lib/python3.11/site-packages/attrdict/__init__.py", line 5, in <module>
          from attrdict.mapping import AttrMap
        File "/root/.pyenv/versions/3.11.0/envs/base/lib/python3.11/site-packages/attrdict/mapping.py", line 4, in <module>
          from collections import Mapping
      ImportError: cannot import name 'Mapping' from 'collections' (/root/.pyenv/versions/3.11.0/lib/python3.11/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 use pyenv, no idea how to switch to clang compilers with pyenv, it might be possible, but I then need to force everything under clang.

you installed 'attrdict' whereas you should to install 'attrdict3'

Ctibor67 commented 1 year ago

I have windows 11. I tried Python 3.11, 3.10, 3.7 and the corresponding wheels wxpython (all 64 bit). I haven't found any combination that doesn't cause the installation to crash. Can you advise me on specific functional packages for installation in Windows 11? Either the error is as mentioned above or this: whl is not a supported wheel on this platform.

oleksis commented 1 year ago

Read this comment for Windows Artifacts

AlejandroFNadal commented 1 year ago

same issue Fedora 36 Python 3.10.8

[fz0x1@fedora ~]$ pip3 install -v --user wxPython
Using pip 22.3.1 from /home/fz0x1/.local/lib/python3.10/site-packages/pip (python 3.10)
Collecting wxPython
  Using cached wxPython-4.2.0.tar.gz (71.0 MB)
  Running command python setup.py egg_info
  /usr/lib/python3.10/site-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
    warnings.warn(
  /usr/lib/python3.10/site-packages/setuptools/dist.py:300: DistDeprecationWarning: use_2to3 is ignored.
    warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
  running egg_info
  creating /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info
  writing /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/dependency_links.txt
  writing entry points to /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/entry_points.txt
  writing requirements to /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/requires.txt
  writing top-level names to /tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'docs/sphinx/build'
  warning: no previously-included files matching '.git' found under directory 'wx'
  warning: no previously-included files matching '*.pyc' found under directory 'wx'
  warning: no previously-included files matching '__pycache__' found under directory 'wx'
  adding license file 'LICENSE.txt'
  writing manifest file '/tmp/pip-pip-egg-info-8cqo__44/wxPython.egg-info/SOURCES.txt'
  Preparing metadata (setup.py) ... done
Collecting pillow
  Downloading Pillow-9.3.0-cp310-cp310-manylinux_2_28_x86_64.whl (3.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 7.1 MB/s eta 0:00:00
Requirement already satisfied: six in /usr/lib/python3.10/site-packages (from wxPython) (1.16.0)
Collecting numpy
  Downloading numpy-1.23.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.1/17.1 MB 19.7 MB/s eta 0:00:00
Installing collected packages: pillow, numpy, wxPython
  changing mode of /home/fz0x1/.local/bin/f2py to 755
  changing mode of /home/fz0x1/.local/bin/f2py3 to 755
  changing mode of /home/fz0x1/.local/bin/f2py3.10 to 755
  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 command Running setup.py install for wxPython
  /usr/lib/python3.10/site-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
    warnings.warn(
  /usr/lib/python3.10/site-packages/setuptools/dist.py:300: DistDeprecationWarning: use_2to3 is ignored.
    warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
  running install
  /usr/lib/python3.10/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
  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.

  "/usr/bin/python3" -u build.py build
  /tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/build.py:43: 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: "/usr/bin/python3"
  3.10.8 (main, Nov 14 2022, 00:00:00) [GCC 12.2.1 20220819 (Red Hat 12.2.1-2)]
  Python's architecture is 64bit
  cfg.VERSION: 4.2.0

  Running command: build
  Running command: build_wx
  wxWidgets build options: ['--wxpython', '--unicode', '--gtk3']
  Configure options: ['--enable-unicode', '--with-gtk=3', '--enable-sound', '--enable-graphics_ctx', '--enable-display', '--enable-geometry', '--enable-debug_flag', '--enable-optimise', '--disable-debugreport', '--enable-uiactionsim', '--enable-autoidman', '--with-sdl']
  /tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/ext/wxWidgets/configure --enable-unicode --with-gtk=3 --enable-sound --enable-graphics_ctx --enable-display --enable-geometry --enable-debug_flag --enable-optimise --disable-debugreport --enable-uiactionsim --enable-autoidman --with-sdl
  checking build system type... x86_64-pc-linux-gnu
  checking host system type... x86_64-pc-linux-gnu
  checking for toolkit... gtk
  checking for gcc... gcc
  checking whether the C compiler works... yes
  checking for C compiler default output file name... a.out
  checking for suffix of executables...
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C compiler... yes
  checking whether gcc accepts -g... yes
  checking for gcc option to accept ISO C89... none needed
  checking whether we are using the Intel C compiler... no
  checking how to run the C preprocessor... gcc -E
  checking for grep that handles long lines and -e... /usr/bin/grep
  checking for egrep... /usr/bin/grep -E
  checking whether gcc needs -traditional... no
  checking for g++... no
  checking for c++... no
  checking for gpp... no
  checking for aCC... no
  checking for CC... no
  checking for cxx... no
  checking for cc++... no
  checking for cl.exe... no
  checking for FCC... no
  checking for KCC... no
  checking for RCC... no
  checking for xlC_r... no
  checking for xlC... no
  checking whether we are using the GNU C++ compiler... no
  checking whether g++ accepts -g... no
  checking whether we are using the Intel C++ compiler... no
  checking whether we are using the Sun C++ compiler... no
  configure: error: C++ compiler is needed to build wxWidgets
  Error running configure
  ERROR: failed building wxWidgets
  Traceback (most recent call last):
    File "/tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/build.py", line 1563, in cmd_build_wx
      wxbuild.main(wxDir(), build_options)
    File "/tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/buildtools/build_wxwidgets.py", line 379, in main
      exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts),
    File "/tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/buildtools/build_wxwidgets.py", line 72, in exitIfError
      raise builder.BuildError(msg)
  buildtools.builder.BuildError: Error running configure
  Finished command: build_wx (0.633s)
  Finished command: build (0.633s)
  Command '"/usr/bin/python3" -u build.py build' failed with exit code 1.
  error: subprocess-exited-with-error

  × Running setup.py install for wxPython did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/bin/python3 -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize

  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)

  __file__ = %r
  sys.argv[0] = __file__

  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"

  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'/tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' install --record /tmp/pip-record-u35w_w1i/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/fz0x1/.local/include/python3.10/wxPython
  cwd: /tmp/pip-install-lp5fz685/wxpython_5c8be3ae91b14de992d164b46d2c1031/
  Running setup.py install for wxPython ... error
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.

solved by installing clang

I solved this by installing attrdict3 and libgtk-4-dev I am using python 3.10.9, debian Testing

tonyrsutton commented 1 year ago

Has there been any further updates on wxPython with Python 3.11.1 yet? Here's mine on Windows 10...

I can confirm that attrdict3 was installed first.

C:\Users\xxxx\Downloads\>pip install wxPython
Collecting wxPython
  Using cached wxPython-4.2.0.tar.gz (71.0 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pillow in c:\program files\python311\lib\site-packages (from wxPython) (9.4.0)
Requirement already satisfied: six in c:\program files\python311\lib\site-packages (from wxPython) (1.16.0)
Requirement already satisfied: numpy in c:\program files\python311\lib\site-packages (from wxPython) (1.24.1)
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
  ╰─> [49 lines of output]
      C:\Program Files\Python311\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:\Program Files\Python311\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:\Program Files\Python311\Lib\site-packages\setuptools\dist.py:317: DistDeprecationWarning: use_2to3 is ignored.
        warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
      running install
      C:\Program Files\Python311\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:\Program Files\Python311\python.exe"
      3.11.1 (tags/v3.11.1:a7a450f, Dec  6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)]
      Python's architecture is 64bit
      cfg.VERSION: 4.2.0
      Running command: build
      Running command: build_wx
      Command '"C:\Program Files\Python311\python.exe" -c "import os, sys, setuptools.msvc; setuptools.msvc.isfile = lambda path: path is not None and os.path.isfile(path); ei = setuptools.msvc.EnvironmentInfo('x64', vc_min_ver=14.0); env = ei.return_env(); env['vc_ver'] = ei.vc_ver; env['vs_ver'] = ei.vs_ver; env['arch'] = ei.pi.arch; env['py_ver'] = sys.version_info[:2]; print(env)"' failed with exit code 1.
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "C:\Program Files\Python311\Lib\site-packages\setuptools\msvc.py", line 1120, in __init__
          self.si = SystemInfo(self.ri, vc_ver)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Program Files\Python311\Lib\site-packages\setuptools\msvc.py", line 596, in __init__
          vc_ver or self._find_latest_available_vs_ver())
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Program Files\Python311\Lib\site-packages\setuptools\msvc.py", line 610, in _find_latest_available_vs_ver
          raise distutils.errors.DistutilsPlatformError(
      distutils.errors.DistutilsPlatformError: No Microsoft Visual C++ version found
      Finished command: build_wx (0.429s)
      Finished command: build (0.429s)
      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:\Program Files\Python311\python.exe" -u build.py build
      Command '"C:\Program Files\Python311\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. 

I did see the "No Microsoft Visual C++ version found" error, but it's already installed. Here's what PowerShell has outputted:

Get-WmiObject -Class Win32_Product -Filter "Version LIKE '14%'" 

IdentifyingNumber : {BD8C6100-7C7D-48DD-93BA-69F6828213FE}
Name              : Microsoft Visual C++ 2019 X86 Additional Runtime - 14.28.29914
Vendor            : Microsoft Corporation
Version           : 14.28.29914
Caption           : Microsoft Visual C++ 2019 X86 Additional Runtime - 14.28.29914

IdentifyingNumber : {5A23DBE2-A05C-4A9C-9C17-EA88BF5D7B43}
Name              : Microsoft Visual C++ 2019 X64 Additional Runtime - 14.28.29914
Vendor            : Microsoft Corporation
Version           : 14.28.29914
Caption           : Microsoft Visual C++ 2019 X64 Additional Runtime - 14.28.29914

IdentifyingNumber : {42365A3A-622A-4EED-A727-FE192A794AFD}
Name              : Microsoft Visual C++ 2019 X86 Minimum Runtime - 14.28.29914
Vendor            : Microsoft Corporation
Version           : 14.28.29914
Caption           : Microsoft Visual C++ 2019 X86 Minimum Runtime - 14.28.29914

IdentifyingNumber : {455DF12C-7D43-4EFF-AE2F-43C8AF2817A3}
Name              : Microsoft Visual C++ 2019 X64 Minimum Runtime - 14.28.29914
Vendor            : Microsoft Corporation
Version           : 14.28.29914
Caption           : Microsoft Visual C++ 2019 X64 Minimum Runtime - 14.28.29914
TheQuinbox commented 1 year ago

@tonyrsutton, yup, getting the same exact thing. Installed Visual Studio Build Tools, and all the VC++ redistributables. Same error.

mworks-proj commented 1 year ago

Did you install attrdict3 before trying to install wxPython? Unfortunately, that needs to happen.

With this fix I was able to finally run

pip3 install --upgrade xrpl-py wxPython requests toml

without any errors. If anyone is still having problems i suggest using

pip3 install (missing pacakges 1 by 1) until no errors occur.

ultrasound1372 commented 1 year ago

Also failing for me here with tchar.h. Windows 10 22H2, Python 3.11.1, in a venv. Pip shows I have attrdict3, certifi, charset-normalizer, idna, numpy, Pillow, requests, six, toml, and urllib3 installed.

Collecting wxpython
  Using cached wxPython-4.2.0.tar.gz (71.0 MB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: pillow in c:\tools\pyo\env\lib\site-packages (from wxpython) (9.4.0)
Requirement already satisfied: six in c:\tools\pyo\env\lib\site-packages (from wxpython) (1.16.0)
Requirement already satisfied: numpy in c:\tools\pyo\env\lib\site-packages (from wxpython) (1.24.2)
Building wheels for collected packages: wxpython
  Building wheel for wxpython (setup.py): started
  Building wheel for wxpython (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  python setup.py bdist_wheel did not run successfully.
  exit code: 1

  [61 lines of output]
  C:\tools\pyo\env\Lib\site-packages\setuptools\dist.py:775: 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:\tools\pyo\env\Lib\site-packages\setuptools\config\setupcfg.py:520: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
    warnings.warn(msg, warning_class)
  C:\tools\pyo\env\Lib\site-packages\setuptools\dist.py:316: DistDeprecationWarning: use_2to3 is ignored.
    warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
  running bdist_wheel
  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:\tools\pyo\env\Scripts\python.exe" -u build.py build
  Will build using: "C:\tools\pyo\env\Scripts\python.exe"
  3.11.1 (tags/v3.11.1:a7a450f, Dec  6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)]
  Python's architecture is 64bit
  cfg.VERSION: 4.2.0

  Running command: build
  Running command: build_wx
  CL.exe: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64\cl.exe
  Downloading microsoft.web.webview2 1.0.1185.39...
  Connection successful...
  Data downloaded...
  wxWidgets build options: ['--wxpython', '--unicode']
  Updating wx/msw/setup.h
  setting build options...
  nmake.exe -f makefile.vc UNICODE=1 OFFICIAL_BUILD=1 COMPILER_VERSION=140 SHARED=1 MONOLITHIC=0 USE_OPENGL=1 USE_GDIPLUS=1 BUILD=release

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

          if not exist vc140_x64_mswudll mkdir vc140_x64_mswudll
          if not exist ..\..\lib\vc140_x64_dll mkdir ..\..\lib\vc140_x64_dll
          if not exist ..\..\lib\vc140_x64_dll\mswu mkdir ..\..\lib\vc140_x64_dll\mswu
          if not exist ..\..\lib\vc140_x64_dll\mswu\wx mkdir ..\..\lib\vc140_x64_dll\mswu\wx
          if not exist ..\..\lib\vc140_x64_dll\mswu\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\vc140_x64_dll\mswu\wx\setup.h
          1 file(s) copied.
          if not exist ..\..\lib\vc140_x64_dll\mswu\wx\msw mkdir ..\..\lib\vc140_x64_dll\mswu\wx\msw
          cl /EP /nologo  "..\..\include\wx\msw\genrcdefs.h" > "..\..\lib\vc140_x64_dll\mswu\wx\msw\rcdefs.h"
  genrcdefs.h
          cl /c /nologo /TC /Fovc140_x64_mswudll\wxregex_pcre2_auto_possess.obj /MD /DWIN32  /Zi /Fd..\..\lib\vc140_x64_dll\wxregexu.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..\..\include /I..\..\lib\vc140_x64_dll\mswu  /I..\..\3rdparty\pcre\src\wx /D__WX__ /DHAVE_CONFIG_H /D_UNICODE    ..\..\3rdparty\pcre\src\pcre2_auto_possess.c
  pcre2_auto_possess.c
  C:\Users\Colton\AppData\Local\Temp\pip-install-rf77wpkr\wxpython_916e3070781e4878ac33baff0fca630f\ext\wxWidgets\include\wx/chartype.h(105): fatal error C1083: Cannot open include file: 'tchar.h': No such file or directory
  NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64\cl.EXE"' : return code '0x2'
  Stop.
  Error building
  ERROR: failed building wxWidgets
  Traceback (most recent call last):
    File "C:\Users\Colton\AppData\Local\Temp\pip-install-rf77wpkr\wxpython_916e3070781e4878ac33baff0fca630f\build.py", line 1563, in cmd_build_wx
      wxbuild.main(wxDir(), build_options)
    File "C:\Users\Colton\AppData\Local\Temp\pip-install-rf77wpkr\wxpython_916e3070781e4878ac33baff0fca630f\buildtools\build_wxwidgets.py", line 503, in main
      exitIfError(wxBuilder.build(dir=buildDir, options=args), "Error building")
    File "C:\Users\Colton\AppData\Local\Temp\pip-install-rf77wpkr\wxpython_916e3070781e4878ac33baff0fca630f\buildtools\build_wxwidgets.py", line 72, in exitIfError
      raise builder.BuildError(msg)
  buildtools.builder.BuildError: Error building
  Finished command: build_wx (0m2.117s)
  Finished command: build (0m2.117s)
  Command '"C:\tools\pyo\env\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: Failed building wheel for wxpython
  Running setup.py clean for wxpython
Failed to build wxpython
Installing collected packages: wxpython
  Running setup.py install for wxpython: started
  Running setup.py install for wxpython: finished with status 'error'
  error: subprocess-exited-with-error

  Running setup.py install for wxpython did not run successfully.
  exit code: 1

  [51 lines of output]
  C:\tools\pyo\env\Lib\site-packages\setuptools\dist.py:775: 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:\tools\pyo\env\Lib\site-packages\setuptools\config\setupcfg.py:520: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
    warnings.warn(msg, warning_class)
  C:\tools\pyo\env\Lib\site-packages\setuptools\dist.py:316: DistDeprecationWarning: use_2to3 is ignored.
    warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
  running install
  C:\tools\pyo\env\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
  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:\tools\pyo\env\Scripts\python.exe" -u build.py build
  Will build using: "C:\tools\pyo\env\Scripts\python.exe"
  3.11.1 (tags/v3.11.1:a7a450f, Dec  6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)]
  Python's architecture is 64bit
  cfg.VERSION: 4.2.0

  Running command: build
  Running command: build_wx
  CL.exe: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64\cl.exe
  wxWidgets build options: ['--wxpython', '--unicode']
  Updating wx/msw/setup.h
  setting build options...
  nmake.exe -f makefile.vc UNICODE=1 OFFICIAL_BUILD=1 COMPILER_VERSION=140 SHARED=1 MONOLITHIC=0 USE_OPENGL=1 USE_GDIPLUS=1 BUILD=release

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

          cl /c /nologo /TC /Fovc140_x64_mswudll\wxregex_pcre2_auto_possess.obj /MD /DWIN32  /Zi /Fd..\..\lib\vc140_x64_dll\wxregexu.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..\..\include /I..\..\lib\vc140_x64_dll\mswu  /I..\..\3rdparty\pcre\src\wx /D__WX__ /DHAVE_CONFIG_H /D_UNICODE    ..\..\3rdparty\pcre\src\pcre2_auto_possess.c
  pcre2_auto_possess.c
  C:\Users\Colton\AppData\Local\Temp\pip-install-rf77wpkr\wxpython_916e3070781e4878ac33baff0fca630f\ext\wxWidgets\include\wx/chartype.h(105): fatal error C1083: Cannot open include file: 'tchar.h': No such file or directory
  NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64\cl.EXE"' : return code '0x2'
  Stop.
  Error building
  ERROR: failed building wxWidgets
  Traceback (most recent call last):
    File "C:\Users\Colton\AppData\Local\Temp\pip-install-rf77wpkr\wxpython_916e3070781e4878ac33baff0fca630f\build.py", line 1563, in cmd_build_wx
      wxbuild.main(wxDir(), build_options)
    File "C:\Users\Colton\AppData\Local\Temp\pip-install-rf77wpkr\wxpython_916e3070781e4878ac33baff0fca630f\buildtools\build_wxwidgets.py", line 503, in main
      exitIfError(wxBuilder.build(dir=buildDir, options=args), "Error building")
    File "C:\Users\Colton\AppData\Local\Temp\pip-install-rf77wpkr\wxpython_916e3070781e4878ac33baff0fca630f\buildtools\build_wxwidgets.py", line 72, in exitIfError
      raise builder.BuildError(msg)
  buildtools.builder.BuildError: Error building
  Finished command: build_wx (0.609s)
  Finished command: build (0.609s)
  Command '"C:\tools\pyo\env\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.
oleksis commented 1 year ago

Updated

planetminguez commented 1 year ago
  Command '"/usr/local/opt/python@3.11/bin/python3.11" /private/var/folders/pw/cgq_81756qq5kk_3wr80w4w00000gn/T/pip-install-mkwgh_8v/wxpython_0aa4b36f20e644ab9ab999582c1f5dc5/bin/waf-2.0.24 --wx_config=/private/var/folders/pw/cgq_81756qq5kk_3wr80w4w00000gn/T/pip-install-mkwgh_8v/wxpython_0aa4b36f20e644ab9ab999582c1f5dc5/build/wxbld/wx-config --python="/usr/local/opt/python@3.11/bin/python3.11" --out=build/waf/3.11 configure build ' failed with exit code 1.
  Finished command: build_py (0m1.576s)
  Finished command: build (0m3.160s)
  Command '"/usr/local/opt/python@3.11/bin/python3.11" -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.

STILL PROBLEMS AS OF 02/20/23 macOS 13.2.1 Ventura......help!!!!!!!!!!!!!

rtibbles commented 1 year ago

Any update on when prebuilt whls will be released? I am also blocked on installing this on MacOS and would ideally need a universal build for MacOS.

ajkaijanaho commented 1 year ago

This is blocking us from moving to Python 3.11 for the same reasons as discussed last year regarding Python 3.10. I hope we can get a release that includes Windows wheels for Python 3.11 earlier than last time.

jawn commented 1 year ago

I'm seeing several projects updating their requirements.txt to work around this issue.

Is it clear what the next action is on this one?

wolfch-elsevier commented 1 year ago

solved by installing clang

How do you make pip / wheel use clang rather then cc ?

planetminguez commented 1 year ago

I dont know.........anybody hears anything,please let me know

On Thu, Feb 23, 2023 at 8:53 PM Richard Tibbles @.***> wrote:

Any update on when prebuilt whls will be released? I am also blocked on installing this on MacOS and would ideally need a universal build for MacOS.

— Reply to this email directly, view it on GitHub https://github.com/wxWidgets/Phoenix/issues/2296#issuecomment-1442682828, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOGH6PPFRL5V3GV45WECGTWZAIA7ANCNFSM6AAAAAARNU53IQ . You are receiving this because you commented.Message ID: @.***>

rtibbles commented 1 year ago

I have managed to build this in a Github Action on a mac, but then the resultant artifact is not behaving as expected, unfortunately. Guessing I am missing some secret sauce.

rtibbles commented 1 year ago

Updated

Hi @oleksis I notice that this build did also build whls for 4.2.1a1 for every platform - is it possible to publish the artifacts for MacOS as well as for Windows?

de-served commented 1 year ago

Upd: I'm new to python. Spent 2 hours trying to install wxWidgets; then attrdict, then found this thread, then attrdict3, then wxWidgets again, then xrpl-py/requests/toml etc, then stuck at No Visual Studio found, then with a schaman drum installed VC and stuck with log attached. Then digged deeper to rtibbles messages, downloaded "artifacts", read what it is, looked inside zip, found "wheels", read how to install in and... installed successfully from previous message "wxPython-4.2.1a1-cp311-cp311-win_amd64.whl". Uninstalled attrdict3, uninstalled xrpl-py etc, wxPython and reinstalled .whl to see that no other packages needed. All seems ok now. (Just seems, not tried to use wxPython for now, very tired of that)

      Will build using: "C:\Programs\Programming\Python\Python311\python.exe"
      3.11.1 (tags/v3.11.1:a7a450f, Dec  6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)]
      Python's architecture is 64bit
      cfg.VERSION: 4.2.0

      Running command: build
      Running command: build_wx
      Command '"C:\Programs\Programming\Python\Python311\python.exe" -c "import os, sys, setuptools.msvc; setuptools.msvc.isfile = lambda path: path is not None and os.path.isfile(path); ei = setuptools.msvc.EnvironmentInfo('x64', vc_min_ver=14.0); env = ei.return_env(); env['vc_ver'] = ei.vc_ver; env['vs_ver'] = ei.vs_ver; env['arch'] = ei.pi.arch; env['py_ver'] = sys.version_info[:2]; print(env)"' failed with exit code 1.
      Traceback (most recent call last):
        File "C:\TEMP\pip-install-vq1_rkuf\wxpython_3f3d9a72216c473e831c32a2e83ba058\build.py", line 2372, in <module>
          main(sys.argv[1:])
        File "C:\TEMP\pip-install-vq1_rkuf\wxpython_3f3d9a72216c473e831c32a2e83ba058\build.py", line 208, in main
          function(options, args)
        File "C:\TEMP\pip-install-vq1_rkuf\wxpython_3f3d9a72216c473e831c32a2e83ba058\build.py", line 1452, in cmd_build
          cmd_build_wx(options, args)
        File "C:\TEMP\pip-install-vq1_rkuf\wxpython_3f3d9a72216c473e831c32a2e83ba058\build.py", line 1462, in cmd_build_wx
          checkCompiler()
        File "C:\TEMP\pip-install-vq1_rkuf\wxpython_3f3d9a72216c473e831c32a2e83ba058\build.py", line 795, in checkCompiler
          info = getMSVCInfo(PYTHON, arch, set_env=True)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\TEMP\pip-install-vq1_rkuf\wxpython_3f3d9a72216c473e831c32a2e83ba058\buildtools\config.py", line 1008, in getMSVCInfo
          env = eval(runcmd('"%s" -c "%s"' % (PYTHON, cmd), getOutput=True, echoCmd=False))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\TEMP\pip-install-vq1_rkuf\wxpython_3f3d9a72216c473e831c32a2e83ba058\buildtools\config.py", line 912, in runcmd
          print(output)
        File "C:\Programs\Programming\Python\Python311\Lib\encodings\cp1251.py", line 19, in encode
          return codecs.charmap_encode(input,self.errors,encoding_table)[0]
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      UnicodeEncodeError: 'charmap' codec can't encode characters in position 1136-1142: character maps to <undefined>
      Finished command: build_wx (0.367s)
      Finished command: build (0.367s)
JessicaTegner commented 1 year ago

A fix that worked for me was.

Open "Developer Command Prompt for VS 2022" pip install attrdict3 pip install requests pip install wxpython (this took around 5-10 minutes on my computer because it builds everything from source)

Caue-Aron commented 1 year ago

A fix that worked for me was.

Open "Developer Command Prompt for VS 2022" pip install attrdict3 pip install requests pip install wxpython (this took around 5-10 minutes on my computer because it builds everything from source)

That didnt end up helpping tho, i still need an answer on how i can do it. I recieved the same errors as you all