Fedora 36 - python 3.10 - can't install from sources

Hi all,

I try to install on a Fedora 36 / python 3.10 platform, with command :
pip wheel -v env4.1.x-py3.10/wxPython-4.1.2a1.dev5412+727f3aff.tar.gz 2>&1 | tee build.log

I failed on this error, see file :

Processing ./env4.1.x-py3.10/wxPython-4.1.2a1.dev5412+727f3aff.tar.gz
  Preparing metadata (setup.py): started
  Running command python setup.py egg_info
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-req-build-00jkfzb_/setup.py", line 27, in <module>
      from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
    File "/tmp/pip-req-build-00jkfzb_/buildtools/config.py", line 30, in <module>
      from attrdict import AttrDict
  ModuleNotFoundError: No module named 'attrdict'
  error: subprocess-exited-with-error
  
  × python setup.py egg_info 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/GestConsoPhoenix4.1.x--1.3.9/env4.1.x-py3.10/bin/python3 -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-00jkfzb_/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' egg_info --egg-base /tmp/pip-pip-egg-info-ur_ti2u3
  cwd: /tmp/pip-req-build-00jkfzb_/
  Preparing metadata (setup.py): finished with status 'error'
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.

so I installed with pip the " attrdict", but run into a new error :

Processing ./env4.1.x-py3.10/wxPython-4.1.2a1.dev5412+727f3aff.tar.gz
  Preparing metadata (setup.py): started
  Running command python setup.py egg_info
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-req-build-njvtnsae/setup.py", line 27, in <module>
      from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
    File "/tmp/pip-req-build-njvtnsae/buildtools/config.py", line 30, in <module>
      from attrdict import AttrDict
    File "/home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.1.x-py3.10/lib64/python3.10/site-packages/attrdict/__init__.py", line 5, in <module>
      from attrdict.mapping import AttrMap
    File "/home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.1.x-py3.10/lib64/python3.10/site-packages/attrdict/mapping.py", line 4, in <module>
      from collections import Mapping
  ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
  error: subprocess-exited-with-error
  
  × python setup.py egg_info 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/GestConsoPhoenix4.1.x--1.3.9/env4.1.x-py3.10/bin/python3 -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-njvtnsae/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' egg_info --egg-base /tmp/pip-pip-egg-info-fm2ftv2y
  cwd: /tmp/pip-req-build-njvtnsae/
  Preparing metadata (setup.py): finished with status 'error'
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 try this workaround :
https://stackoverflow.com/questions/69381312/in-vs-code-importerror-cannot-import-name-mapping-from-collections

But it is useless, new error …

Is it a problem with wxPython’s build ?..
What do you think ?

Thank you for any help :slight_smile:

Try: pip install attrdict3

Then try installing wxPython again.

Thank you swt2c.

After your command, I get now : ModuleNotFoundError: No module named ‘sipbuild’

(env4.1.x-py3.10) [redge@fedora GestConsoPhoenix4.1.x--1.3.9]$ pip install attrdict3
Collecting attrdict3
  Downloading attrdict3-2.0.2-py2.py3-none-any.whl (10 kB)
Requirement already satisfied: six in ./env4.1.x-py3.10/lib/python3.10/site-packages (from attrdict3) (1.16.0)
Installing collected packages: attrdict3
Successfully installed attrdict3-2.0.2
(env4.1.x-py3.10) [redge@fedora GestConsoPhoenix4.1.x--1.3.9]$ pip wheel -v env4.1.x-py3.10/wxPython-4.1.2a1.dev5412+727f3aff.tar.gz  2>&1 | tee build.log
Processing ./env4.1.x-py3.10/wxPython-4.1.2a1.dev5412+727f3aff.tar.gz
  Preparing metadata (setup.py): started
  Running command python setup.py egg_info
  /home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.1.x-py3.10/lib/python3.10/site-packages/setuptools/dist.py:772: 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.1.x-py3.10/lib/python3.10/site-packages/setuptools/config/setupcfg.py:459: 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.1.x-py3.10/lib/python3.10/site-packages/setuptools/dist.py:318: DistDeprecationWarning: use_2to3 is ignored.
    warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
  running egg_info
  creating /tmp/pip-pip-egg-info-3dwnhz91/wxPython.egg-info
  writing /tmp/pip-pip-egg-info-3dwnhz91/wxPython.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-3dwnhz91/wxPython.egg-info/dependency_links.txt
  writing entry points to /tmp/pip-pip-egg-info-3dwnhz91/wxPython.egg-info/entry_points.txt
  writing requirements to /tmp/pip-pip-egg-info-3dwnhz91/wxPython.egg-info/requires.txt
  writing top-level names to /tmp/pip-pip-egg-info-3dwnhz91/wxPython.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-3dwnhz91/wxPython.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-pip-egg-info-3dwnhz91/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-3dwnhz91/wxPython.egg-info/SOURCES.txt'
  Preparing metadata (setup.py): finished with status 'done'
Collecting pillow
  File was already downloaded /home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/Pillow-9.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Collecting six
  File was already downloaded /home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/six-1.16.0-py2.py3-none-any.whl
Collecting numpy
  File was already downloaded /home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/numpy-1.22.4-cp310-cp310-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/GestConsoPhoenix4.1.x--1.3.9/env4.1.x-py3.10/lib/python3.10/site-packages/setuptools/dist.py:772: 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.1.x-py3.10/lib/python3.10/site-packages/setuptools/config/setupcfg.py:459: 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.1.x-py3.10/lib/python3.10/site-packages/setuptools/dist.py:318: 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.

  "/home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.1.x-py3.10/bin/python" -u build.py build
  Traceback (most recent call last):
    File "/tmp/pip-req-build-c209y9v9/build.py", line 49, in <module>
      from buildtools.wxpysip import sip_runner
    File "/tmp/pip-req-build-c209y9v9/buildtools/wxpysip.py", line 20, in <module>
      from sipbuild.code_generator import (set_globals, parse, generateCode,
  ModuleNotFoundError: No module named 'sipbuild'
  Command '"/home/redge/Developpement/GestConsoPhoenix4.1.x--1.3.9/env4.1.x-py3.10/bin/python" -u build.py build' failed with exit code 1.
  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/GestConsoPhoenix4.1.x--1.3.9/env4.1.x-py3.10/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-c209y9v9/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /tmp/pip-wheel-u6l7jdct
  cwd: /tmp/pip-req-build-c209y9v9/
  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.1.x-py3.10/lib/python3.10/site-packages/setuptools/dist.py:772: 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.1.x-py3.10/lib/python3.10/site-packages/setuptools/config/setupcfg.py:459: 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.1.x-py3.10/lib/python3.10/site-packages/setuptools/dist.py:318: 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
(env4.1.x-py3.10) [redge@fedora GestConsoPhoenix4.1.x--1.3.9]$ 

What else can you advise me ?

The command :
pip install sip==5.5.0

Seems to unlock the situation… generating build is in progress … :slight_smile:

I will let you know about the final step if it achieves fine.

pip install sip == 5.5.0

Problem solved !
I reach to create the wheel file : and wxPython works well as expected :+1:

Thanks again swt2c, have a nice evening :slight_smile: