attrdict a requirement for pip install fails otherwise.
PS C:\Users\Tat\PycharmProjects\meerk40t> pip install wxPython
Collecting wxPython
Downloading wxPython-4.2.0.tar.gz (71.0 MB)
---------------------------------------- 71.0/71.0 MB 735.6 kB/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 "C:\Users\Tat\AppData\Local\Temp\pip-install-n4x9oroc\wxpython_3fcdd7a92a3246c686817597dd963d32\setup.py", line 27, in <module>
from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
File "C:\Users\Tat\AppData\Local\Temp\pip-install-n4x9oroc\wxpython_3fcdd7a92a3246c686817597dd963d32\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.
It fixed and installed after pip install attrdict but I don't usually expect failure to pip install.
It fixed and installed after
pip install attrdictbut I don't usually expect failure to pip install.
But with python 3.10 on my ArchLinux it is raising the following error:
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-v2d0o325/wxpython_2d295bd40b8f4afcb9fdee5d09790f32/setup.py", line 27, in <module>
from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
File "/tmp/pip-install-v2d0o325/wxpython_2d295bd40b8f4afcb9fdee5d09790f32/buildtools/config.py", line 30, in <module>
from attrdict import AttrDict
File "/home/harry/.pyvenv/general/lib/python3.10/site-packages/attrdict/__init__.py", line 5, in <module>
from attrdict.mapping import AttrMap
File "/home/harry/.pyvenv/general/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.
It seems that attrdict is incompatible with python 3.10. This is caused by a change in the collections interface starting with Python 3.10.
You need attrdict3 not attrdict. Note that it is only actually used on Windows currently, so I submitted a PR to remove it on other platforms, see #2224
My linux unittest started failing due to that too. I sort of expect those kinks to get worked out. And the wheels really should have deployed I think for my OS but I'm not too worried since it bleeding edge.
@tatarize, what is your OS and Python version?
@swt2c installing attrdict3 works for me for now. Thanks.
@tatarize, what is your OS and Python version?
Windows 7. Python 3.8 but I also had unittest in linux fail along the same lines it was trying to install wxPython for a thing it didn't really need it for.
I had the same issue on arch linux recently. If for some reason older versions of wxPython with python 3.10 are needed, you can change the import occurrences of from collections to from collections.abc within the attrdict library.
You need
attrdict3notattrdict. Note that it is only actually used on Windows currently, so I submitted a PR to remove it on other platforms, see #2224
It's not only used on Windows, hence why builds are now failing on Linux. At the very least, it is needed when the wheel is built from source (as it always is on Linux). I'm afraid I don't know the inner workings of wxpython better to narrow it down further.
Here is my pip error log:
Command ['/home/alex/code/iPANACEA/.venv/bin/pip', 'install', '--no-deps', '-U', 'file:///home/alex/.cache/pypoetry/artifacts/82/c0/3a/d4a405db6cce1fdd910ba65dd2db32dcba675b4efec2e445f4140c6fa6/wxPython-4.2.0.tar.gz'] errored with the following return code 1, and output:
Processing /home/alex/.cache/pypoetry/artifacts/82/c0/3a/d4a405db6cce1fdd910ba65dd2db32dcba675b4efec2e445f4140c6fa6/wxPython-4.2.0.tar.gz
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status '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-req-build-oy_awq84/setup.py", line 27, in <module>
from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
File "/tmp/pip-req-build-oy_awq84/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
There isn't any need to narrow it down further. You need to install attrdict3 in order to build wxPython 4.2.0. In the future, you'll only need it on Windows.
The objection I had was that Linux stopped working. I had some github Linux thing that required wx for unit tests and it threw that error. It didn't work in my windows7 python3.8 setup either since it demanded the attrdict thing.
With the merge of not requiring this for Linux this might be closable. I'm used to just getting a valid wheels for windows rather than it trying to compile the whole thing that it doesn't seem like it should have thrown that error at me there either. But, that might be fixable and the Windows10/Python 3.10 system had it install without issue.
I did just remove wx from the linux unittests since they were never used. So I might not be well versed on all the threads of this issue.
There isn't any need to narrow it down further. You need to install
attrdict3in order to build wxPython 4.2.0. In the future, you'll only need it on Windows.
But the point is that you don't have a choice but to build it on Linux, so if you run pip install wxpython it currently just errors out. So on Linux it is a required dependency if you want users to be able to actually install wxpython.
On Ubuntu 20.04.4 with kernel 5.15 Python 3.8 and wxPython 4.2.0
I got almost the same error:
$ pip3 install wxPython
Defaulting to user installation because normal site-packages is not writeable
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-n3c8k4cd/wxpython_e93e7db2517a413b9c0dc98d551d966a/setup.py", line 27, in <module>
from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
File "/tmp/pip-install-n3c8k4cd/wxpython_e93e7db2517a413b9c0dc98d551d966a/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.
Fixed it with: pip3 install attrdict
I am getting the same error on CentOS 7.8.2003, python version 3.6.8, wxPython version 4.2.0.
Adding attrdict and/or attrdict3 to my requirements file ahead of wxpython does not solve the issue.
I am getting the same error on CentOS 7.8.2003, python version 3.6.8, wxPython version 4.2.0.
Adding attrdict and/or attrdict3 to my requirements file ahead of wxpython does not solve the issue.
@forchtj I have the same error on wine/windows, python version 3.6.8, wxPython version 4.2.0.
But when I downgrade to wxPython 4.1.1, the error was gone.
Tbh I'm rather disappointed at the devs' lack of response here.
This breaks things for Linux users -- for example my CI is now failing for a number of projects and the only sensible fix is to pin wxpython to an older version. The offending commit should clearly just be reverted.
Which offending commit?
Thanks for your response! I think this is the one: https://github.com/wxWidgets/Phoenix/pull/2224/commits/2e9169effa9abf14f34f8436a791b8829eea7774
If I understand correctly, it removes attrdict3 as a dev dependency for Linux, meaning building wxpython (e.g. when you run pip install wxpython) will fail due to a missing import.
No, sorry - that FIXES the problem you're seeing.
As a workaround for your CI, you can 'pip install attrdict3' before trying to install wxpython.
So just to be clear, the intention of wxpython's developers is that pip install wxpython should be guaranteed to fail on Linux unless they execute another command beforehand?! That's a pretty user-hostile design :disappointed:
What's so important about that commit that it's worth breaking your users for?
Sorry, but you're misunderstanding the problem. When you're running pip install wxpython what you're getting DOES NOT include that commit!
I have the same problem today. I was expecting pip install wxpython to work. This comment matches my exact experience: https://github.com/wxWidgets/Phoenix/issues/2225#issuecomment-1209538326
I guess building the 4.2.0 release is broken under modern linuxes because of the attrdict module import. Deleting https://github.com/wxWidgets/Phoenix/blob/b567d1e6e3aff88f900d5ec4fb148531746b211d/buildtools/config.py#L30 seems to solve the problem for me and it looks like that's already been done in the main branch via https://github.com/wxWidgets/Phoenix/commit/2e9169effa9abf14f34f8436a791b8829eea7774 So those wanting to build 4.2.0 (the latest stable release as of this writing) need to either patch it before building or wait for a new release that rolls in the fix from https://github.com/wxWidgets/Phoenix/commit/2e9169effa9abf14f34f8436a791b8829eea7774.
I'm pretty sure the commit you cited is to fix the issue. What you actually want is the releases of 4.2.0-post1 with that commit in place. Such that installs in Linux are not strange and crashing. We need the pip version to actually work. We don't want to wait a year for that to happen.
Any idea when that release that rolls in these fixes might be dropping? I literally can't install wxpython using pipenv at the moment (on Linux), even if I add attrdict or attrdict3 to my list of dependencies. I have a workaround, but it would be very helpful if a point release with this fix could occur somewhat soon.
Also failing on macOS
Collecting wxpython>=4.0.7
Downloading wxPython-4.2.0.tar.gz (71.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 71.0/71.0 MB 595.3 kB/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 "/private/var/folders/d_/fmfzzc2d37d8l9mw_2bblb8c0000gn/T/pip-install-d44rs5mb/wxpython_68fa328d33c84a89aa8ade7190cc500c/setup.py", line 27, in <module>
from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
File "/private/var/folders/d_/fmfzzc2d37d8l9mw_2bblb8c0000gn/T/pip-install-d44rs5mb/wxpython_68fa328d33c84a89aa8ade7190cc500c/buildtools/config.py", line 30, in <module>
from attrdict import AttrDict
ModuleNotFoundError: No module named 'attrdict'
I confirm attrdict3 is required on Ubuntu 22.04.1:
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-sspcjaa7/wxpython_f8532717e5604e72b04bc649051e86a2/setup.py", line 27, in <module>
from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
File "/tmp/pip-install-sspcjaa7/wxpython_f8532717e5604e72b04bc649051e86a2/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.
If I do this before relaunching the command that requires wxPython:
$ pip install attrdict3
Defaulting to user installation because normal site-packages is not writeable
Collecting attrdict3
Downloading attrdict3-2.0.2-py2.py3-none-any.whl (10 kB)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from attrdict3) (1.16.0)
Installing collected packages: attrdict3
Successfully installed attrdict3-2.0.2
Everything works perfecly.
ı try install arch linux and windows 8.1 same ı can't install
Has this been fixed on the main branch yet? When will this find its way into a point release?
macOS has same issue, and already check is occur by "attrdict"
I think attrdict3 should be add into dependency, not ask developer manual install it.