Can't install from sources wxpython 4.2.0a1 - python 3.10 - Mint 21

Hi all,

I’m trying to install wxpython 4.2.0a1 on Mint 21 with python 3.10, but get the error :

3 configure build
  Setting top to                           : /tmp/pip-req-build-k1zreacm
  Setting out to                           : /tmp/pip-req-build-k1zreacm/build/waf/3.10/gtk3
  Checking for 'gcc' (C compiler)          : /usr/bin/gcc
  Checking for 'g++' (C++ compiler)        : /usr/bin/g++
  Checking for program 'python'            : /home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.2.x-py310/bin/python
  Checking for python version >= 3.7.0     : 3.10.4
  python-config                            : /usr/bin/python3.10-config
  Asking python-config for pyext '--cflags --libs --ldflags' flags : yes
  Testing pyext configuration                                      : yes
  Finding libs for WX                                              : yes
  Finding libs for WXADV                                           : yes
  Finding libs for WXSTC                                           : yes
  Finding libs for WXHTML                                          : yes
  Finding libs for WXGL                                            : yes
  Finding libs for WXWEBVIEW                                       : yes
  Finding libs for WXXML                                           : yes
  Finding libs for WXXRC                                           : yes
  Finding libs for WXRICHTEXT                                      : yes
  Finding libs for WXMEDIA                                         : yes
  Finding libs for WXRIBBON                                        : yes
  Finding libs for WXPROPGRID                                      : yes
  Finding libs for WXAUI                                           : yes
  'configure' finished successfully (1.706s)
  Waf: Entering directory `/tmp/pip-req-build-k1zreacm/build/waf/3.10/gtk3'
  **** Compiler: gcc --version
       gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
       Copyright (C) 2021 Free Software Foundation, Inc.
       This is free software; see the source for copying conditions.  There is NO
       warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  Traceback (most recent call last):
    File "/tmp/pip-req-build-k1zreacm/bin/.waf3-2.0.22-1241519b19b496207abef1f72bbf61c2/waflib/Scripting.py", line 119, in waf_entry_point
      run_commands()
    File "/tmp/pip-req-build-k1zreacm/bin/.waf3-2.0.22-1241519b19b496207abef1f72bbf61c2/waflib/Scripting.py", line 182, in run_commands
      ctx=run_command(cmd_name)
    File "/tmp/pip-req-build-k1zreacm/bin/.waf3-2.0.22-1241519b19b496207abef1f72bbf61c2/waflib/Scripting.py", line 173, in run_command
      ctx.execute()
    File "/tmp/pip-req-build-k1zreacm/bin/.waf3-2.0.22-1241519b19b496207abef1f72bbf61c2/waflib/Scripting.py", line 375, in execute
      return execute_method(self)
    File "/tmp/pip-req-build-k1zreacm/bin/.waf3-2.0.22-1241519b19b496207abef1f72bbf61c2/waflib/Build.py", line 93, in execute
      self.execute_build()
    File "/tmp/pip-req-build-k1zreacm/bin/.waf3-2.0.22-1241519b19b496207abef1f72bbf61c2/waflib/Build.py", line 96, in execute_build
      self.recurse([self.run_dir])
    File "/tmp/pip-req-build-k1zreacm/bin/.waf3-2.0.22-1241519b19b496207abef1f72bbf61c2/waflib/Context.py", line 133, in recurse
      user_function(self)
    File "/tmp/pip-req-build-k1zreacm/wscript", line 531, in build
      updateLicenseFiles(cfg)
    File "/tmp/pip-req-build-k1zreacm/buildtools/config.py", line 1059, in updateLicenseFiles
      copy_file(opj('sip', 'siplib', 'LICENSE'), opj('license', 'sip-license.txt'),
    File "/home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.2.x-py310/lib/python3.10/site-packages/setuptools/_distutils/file_util.py", line 115, in copy_file
      raise DistutilsFileError(
  distutils.errors.DistutilsFileError: can't copy 'sip/siplib/LICENSE': doesn't exist or not a regular file
  Command '"/home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.2.x-py310/bin/python" /tmp/pip-req-build-k1zreacm/bin/waf-2.0.22 --wx_config=/tmp/pip-req-build-k1zreacm/build/wxbld/gtk3/wx-config --gtk3 --python="/home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.2.x-py310/bin/python" --out=build/waf/3.10/gtk3 configure build ' failed with exit code 2.
  Finished command: build_py (0m2.282s)
  Finished command: build (11m59.642s)
  Command '"/home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.2.x-py310/bin/python" -u build.py build' failed with exit code 2.
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 2
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.2.x-py310/bin/python -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-req-build-k1zreacm/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /tmp/pip-wheel-apuh7hr3
  cwd: /tmp/pip-req-build-k1zreacm/
  Building wheel for wxPython (setup.py): finished with status 'error'
  ERROR: Failed building wheel for wxPython
  Running setup.py clean for wxPython
  Running command python setup.py clean
  /home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.2.x-py310/lib/python3.10/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(
  /home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.2.x-py310/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
    warnings.warn(msg, warning_class)
  /home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.2.x-py310/lib/python3.10/site-packages/setuptools/dist.py:317: DistDeprecationWarning: use_2to3 is ignored.
    warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
  running clean
  'build/lib.linux-x86_64-cpython-310' does not exist -- can't clean it
  'build/bdist.linux-x86_64' does not exist -- can't clean it
  'build/scripts-3.10' does not exist -- can't clean it
Failed to build wxPython
ERROR: Failed to build one or more wheels

I installed “pip install attrdict3”, and “pip install sip==5.5.0”, but I can"t achieve to run the installation.

Any idea ?

Thanks for reading

(env4.2.x-py310) redge@redge-VirtualBox:~/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.2.x-py310$ python
Python 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> print (setuptools.__version__)
63.4.1
>>> 

I run in error with : wxPython-4.2.0a1.dev5447+fd6b4814.tar.gz

But it runs successfully with : wxPython-4.1.2a1.dev5425+8fae1c28.tar.gz

Any idea with this behaviour ?

Thanks

I think I fixed that problem, but the snapshot buildbot hasn’t been
running in about a month to generate new snapshots. :frowning: Hopefully Robin
can fix it soon.

Scott

It’s fixed. (A docker container appeared to still be running, but apparently it had stopped talking to the buildbot server.)

Also, the current sip requirement is 6.6.2.

Thank you swt2c & Robin :wink:

I tried :

pip wheel -v wxPython-4.2.0.tar.gz  2>&1 | tee build.log

But it run in error :

(env4.2.x-py38) [redge@localhost env4.2.x-py38]$ pip wheel -v wxPython-4.2.0.tar.gz  2>&1 | tee build.log
Processing ./wxPython-4.2.0.tar.gz
  File was already downloaded /home/redge/Developpement/Python/GestionConsommation/GestConsoPhoenix4.1.x--1.3.10/env4.2.x-py38/wxPython-4.2.0.tar.gz
  Preparing metadata (setup.py): started
  Running command python setup.py egg_info
  running egg_info
  creating /tmp/pip-pip-egg-info-oi82id0e/wxPython.egg-info
  writing /tmp/pip-pip-egg-info-oi82id0e/wxPython.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-oi82id0e/wxPython.egg-info/dependency_links.txt
  writing entry points to /tmp/pip-pip-egg-info-oi82id0e/wxPython.egg-info/entry_points.txt
  writing requirements to /tmp/pip-pip-egg-info-oi82id0e/wxPython.egg-info/requires.txt
  writing top-level names to /tmp/pip-pip-egg-info-oi82id0e/wxPython.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-oi82id0e/wxPython.egg-info/SOURCES.txt'
  /home/redge/Developpement/Python/GestionConsommation/GestConsoPhoenix4.1.x--1.3.10/env4.2.x-py38/lib64/python3.8/site-packages/setuptools/dist.py:648: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
    warnings.warn(
  warning: the 'license_file' option is deprecated, use 'license_files' instead
  adding license file 'LICENSE.txt' (matched pattern 'LICENSE.txt')
  reading manifest file '/tmp/pip-pip-egg-info-oi82id0e/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'
  writing manifest file '/tmp/pip-pip-egg-info-oi82id0e/wxPython.egg-info/SOURCES.txt'
  Preparing metadata (setup.py): finished with status 'done'
Collecting pillow
  File was already downloaded /home/redge/Developpement/Python/GestionConsommation/GestConsoPhoenix4.1.x--1.3.10/env4.2.x-py38/Pillow-9.2.0-cp38-cp38-manylinux_2_28_x86_64.whl
Collecting six
  File was already downloaded /home/redge/Developpement/Python/GestionConsommation/GestConsoPhoenix4.1.x--1.3.10/env4.2.x-py38/six-1.16.0-py2.py3-none-any.whl
Collecting numpy
  File was already downloaded /home/redge/Developpement/Python/GestionConsommation/GestConsoPhoenix4.1.x--1.3.10/env4.2.x-py38/numpy-1.23.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Building wheels for collected packages: wxPython
  Building wheel for wxPython (setup.py): started
  Running command python setup.py bdist_wheel
  /home/redge/Developpement/Python/GestionConsommation/GestConsoPhoenix4.1.x--1.3.10/env4.2.x-py38/lib64/python3.8/site-packages/setuptools/dist.py:648: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead
    warnings.warn(
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel 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: /home/redge/Developpement/Python/GestionConsommation/GestConsoPhoenix4.1.x--1.3.10/env4.2.x-py38/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-req-build-8bu543c7/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /tmp/pip-wheel-l70jnyd6
  cwd: /tmp/pip-req-build-8bu543c7/
  Building wheel for wxPython (setup.py): finished with status 'error'
  ERROR: Failed building wheel for wxPython
  Running setup.py clean for wxPython
  Running command python setup.py clean
  /home/redge/Developpement/Python/GestionConsommation/GestConsoPhoenix4.1.x--1.3.10/env4.2.x-py38/lib64/python3.8/site-packages/setuptools/dist.py:648: 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 clean
  'build/lib.linux-x86_64-3.8' does not exist -- can't clean it
  'build/bdist.linux-x86_64' does not exist -- can't clean it
  'build/scripts-3.8' does not exist -- can't clean it
Failed to build wxPython
ERROR: Failed to build one or more wheels

But setuptools is installed :

(env4.2.x-py38) [redge@localhost env4.2.x-py38]$ python
Python 3.8.12 (default, Sep 12 2021, 19:57:22) 
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> print (setuptools.__version__)
63.4.2
>>>

What am I doing wrong ?..

Thanks

Your Python needs to have some additional packages installed to do a build. See Phoenix/requirements at master · wxWidgets/Phoenix · GitHub

That’s right, I forgot to install “wheel & six” as you mentioned in the recipe :

pip install -U six wheel setuptools

I missed a step following your recipe :
https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/index.html

Thanks a lot Robin (and sorry for the disturbance) :slight_smile:

I’m trying to follow the instructions at Building wxPython for Linux via Pip | wxPython
but things stall when I execute pip download wxPython with
(builder_py) arnold@CarboMint:~/Public/wpTemp$ pip download 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
╰─> [8 lines of output]
Traceback (most recent call last):
File “”, line 2, in
File “”, line 34, in
File “/tmp/pip-download-2mccg5_v/wxpython_47da98256ff747579539ed405a65ec0a/setup.py”, line 27, in
from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
File “/tmp/pip-download-2mccg5_v/wxpython_47da98256ff747579539ed405a65ec0a/buildtools/config.py”, line 30, in
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.
(builder_py) arnold@CarboMint:~/Public/wpTemp$

Hi,

Try to install attrdict3 :

pip install attrdict3

No luck
arnold@CarboMint:~/Public/wpTemp/builder_py$ pip install attrdict3
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: attrdict3 in /usr/local/lib/python3.10/dist-packages (2.0.2)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from attrdict3) (1.16.0)

Try the use of virtualenv :
https://naysan.ca/2019/08/05/install-python-3-virtualenv-on-ubuntu/

Then apply the recipe you indicate : since " Build Steps" / Step 1, and so on…

This way you will not be limited with security issue.

I don’t recall which Ubuntu that version of Mint was based on, but one of the 4.2.0 wheels from a Ubuntu folder here Index of /wxPython4/extras/linux/gtk3 will work for you. If not, then I 2nd the recommendation to use a venv, and also to unpack the archive and use requirements.txt (and the requirements folder) to make sure you have all the needed packages installed in that venv.

There may also be dev packages for GTK or other 3rd party libraries that you need installed on the system. Watch for errors or warnings in the log from the wxWidgets configure step to find those. You can also look at one of the docker/build/ubuntu-*/Dockerfile files in the source archive to see what system packages I install when building the wheels for Linux.

Thank you both.
Using the instructions from Zylyco, I created a new VE in my testing base directory.
just “python -m pip install wxPython” did the trick and installed everything without any problem.
After activating the VE, all I needed to do was install a couple more dependencies and my test GUI ran.
Now I have to sort out which IDE I want to/ can use to debug the rest of the code and how to make the best of it.