Skip to content

Installation with pip fails - cannot import name 'Mapping' from 'collections' #2236

@prehensilecode

Description

@prehensilecode

Operating system: Ubuntu 22.04.1
wxPython version & source: 4.20 via PyPI
Python version & source: 3.10.4 (self-built from source)

Description of the problem:

Installation of wxPython via pip fails:

❯ python3 --version
Python 3.10.4
❯ pip3 --version
pip 22.2.2 from /usr/local/lib/python3.10/site-packages/pip (python 3.10)
❯ pip3 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-3w2d1qtq/wxpython_d19543ef48a6426f84814843fbdf9d7d/setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "/tmp/pip-install-3w2d1qtq/wxpython_d19543ef48a6426f84814843fbdf9d7d/buildtools/config.py", line 30, in <module>
          from attrdict import AttrDict
        File "/usr/local/lib/python3.10/site-packages/attrdict/__init__.py", line 5, in <module>
          from attrdict.mapping import AttrMap
        File "/usr/local/lib/python3.10/site-packages/attrdict/mapping.py", line 4, in <module>
          from collections import Mapping
      ImportError: cannot import name 'Mapping' from 'collections' (/usr/local/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions