wxWidgets / Phoenix

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

wxpython 4.2 ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py) #2310

Closed struts2spring closed 1 year ago

struts2spring commented 1 year ago

Operating system: wxPython version & source: Python version & source:

Description of the problem:

Code Example (click to expand) ```python # Put code sample here ```

(.venv) vijay@vijay:/data/source/wxpython/Phoenix$ 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
  ╰─> [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-fk1xgd7l/wxpython_a6f06eae41e84ed3836db7f734b1b2a1/setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "/tmp/pip-install-fk1xgd7l/wxpython_a6f06eae41e84ed3836db7f734b1b2a1/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.
(.venv) vijay@vijay:/data/source/wxpython/Phoenix$ pip install attrdict
Collecting attrdict
  Using cached attrdict-2.0.1-py2.py3-none-any.whl (9.9 kB)
Collecting six
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, attrdict
Successfully installed attrdict-2.0.1 six-1.16.0
(.venv) vijay@vijay:/data/source/wxpython/Phoenix$ 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-0801f4xx/wxpython_f895a36dafd24cad90e9fabbe2491985/setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "/tmp/pip-install-0801f4xx/wxpython_f895a36dafd24cad90e9fabbe2491985/buildtools/config.py", line 30, in <module>
          from attrdict import AttrDict
        File "/data/source/wxpython/.venv/lib/python3.10/site-packages/attrdict/__init__.py", line 5, in <module>
          from attrdict.mapping import AttrMap
        File "/data/source/wxpython/.venv/lib/python3.10/site-packages/attrdict/mapping.py", line 4, in <module>
          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.
(.venv) vijay@vijay:/data/source/wxpython/Phoenix$ 
foozzi commented 1 year ago

Operating system:

wxPython version & source:

Python version & source:

Description of the problem:

Code Example (click to expand) ```python # Put code sample here ```

(.venv) vijay@vijay:/data/source/wxpython/Phoenix$ 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

  ╰─> [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-fk1xgd7l/wxpython_a6f06eae41e84ed3836db7f734b1b2a1/setup.py", line 27, in <module>

          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName

        File "/tmp/pip-install-fk1xgd7l/wxpython_a6f06eae41e84ed3836db7f734b1b2a1/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.

(.venv) vijay@vijay:/data/source/wxpython/Phoenix$ pip install attrdict

Collecting attrdict

  Using cached attrdict-2.0.1-py2.py3-none-any.whl (9.9 kB)

Collecting six

  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)

Installing collected packages: six, attrdict

Successfully installed attrdict-2.0.1 six-1.16.0

(.venv) vijay@vijay:/data/source/wxpython/Phoenix$ 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-0801f4xx/wxpython_f895a36dafd24cad90e9fabbe2491985/setup.py", line 27, in <module>

          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName

        File "/tmp/pip-install-0801f4xx/wxpython_f895a36dafd24cad90e9fabbe2491985/buildtools/config.py", line 30, in <module>

          from attrdict import AttrDict

        File "/data/source/wxpython/.venv/lib/python3.10/site-packages/attrdict/__init__.py", line 5, in <module>

          from attrdict.mapping import AttrMap

        File "/data/source/wxpython/.venv/lib/python3.10/site-packages/attrdict/mapping.py", line 4, in <module>

          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.

(.venv) vijay@vijay:/data/source/wxpython/Phoenix$ 

You should to install 'attrdict3' instead 'attrdict'

swt2c commented 1 year ago

@foozzi is correct.

NetScr1be commented 1 year ago

Same Problem on Windows 10

Package Version
python Python 3.11.2
attrdict 2.0.1
attrdict3 2.0.2
mapping 0.1.6

pip3 install --upgrade wxPython

returns

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 "C:\Users\patrick\AppData\Local\Temp\pip-install-asz3wo1t\wxpython_e06b12e77b8a4f3f9020ce0fc13984f3\setup.py", line 27, in from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName File "C:\Users\patrick\AppData\Local\Temp\pip-install-asz3wo1t\wxpython_e06b12e77b8a4f3f9020ce0fc13984f3\buildtools\config.py", line 30, in from attrdict import AttrDict File "C:\Python311\Lib\site-packages\attrdict__init.py", line 5, in from attrdict.mapping import AttrMap File "C:\Python311\Lib\site-packages\attrdict\mapping.py", line 4, in from collections import Mapping ImportError: cannot import name 'Mapping' from 'collections' (C:\Python311\Lib\collections\init__.py) [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.`

NetScr1be commented 1 year ago

@foozzi

C:\Users\patrick\Projects\XRPL\wallet.py>pip uninstall attrdict

Found existing installation: attrdict 2.0.1 Uninstalling attrdict-2.0.1: Would remove: c:\python311\lib\site-packages\attrdict-2.0.1.dist-info* c:\python311\lib\site-packages\attrdict* Proceed (Y/n)? Successfully uninstalled attrdict-2.0.1

This leaves only attrdict3 installed

C:\Users\patrick\Projects\XRPL\wallet.py>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 ╰─> [8 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "C:\Users\patrick\AppData\Local\Temp\pip-install-aglqm8fj\wxpython_7fb354f9c6ba4ea1971d18116ea5f68e\setup.py", line 27, in from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName File "C:\Users\patrick\AppData\Local\Temp\pip-install-aglqm8fj\wxpython_7fb354f9c6ba4ea1971d18116ea5f68e\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.

acffordyce973 commented 1 year ago

Having the same issue. Only attrdict3 is installed on Python 3.10.