Детали системы:
Описание проблемы:
При установке wxPython (последняя версия 4.2.0) я получаю сообщение об ошибке, что зависимость attrdict
не найдена, хотя она установлена.
(.venv) user@raspberrypi:~/Documents $ python --version
Python 3.11.3
(.venv) user@raspberrypi:~/Documents $ python -m pip freeze
attrdict==2.0.1
attrdict3==2.0.2
dbus-fast==1.86.0
pytz==2023.3
six==1.16.0
tzdata==2023.3
(.venv) user@raspberrypi:~/Documents $ python -m pip install wxPython
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting wxPython
Using cached wxPython-4.2.0.tar.gz (71.0 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
Traceback (most recent call last):
File "/home/user/Documents/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/user/Documents/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/Documents/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-fs9i9itq/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-fs9i9itq/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-fs9i9itq/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 488, in run_setup
self).run_setup(setup_script=setup_script)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-fs9i9itq/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
exec(code, locals())
File "<string>", line 27, in <module>
File "/tmp/pip-install-6s5ym1hn/wxpython_0afd12e3eb4741b4854a998e85194d91/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: subprocess-exited-with-error
× Getting requirements to build 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.
(.venv) user@raspberrypi:~/Documents $
Почему он говорит, что зависимость не может быть найдена, когда она явно существует? Есть ли способ исправить эту ошибку и установить wxPython в моей системе?
Я также открыл вопрос на странице wxPython GitHub: https://github.com/wxWidgets/Phoenix/issues/2401
Итак, у меня были похожие проблемы, и я понял, что некоторые модули wxPython не поддерживаются в последних версиях Python.
Итак, чтобы это исправить, я удалил Python и установил Python v.3.9.12.
Примечание. Вам также может потребоваться переустановить wxPython после понижения версии Python для нужд зависимостей.
Надеюсь это поможет!
Да, я уже установил его на Python 3.9 (распространяется вместе с Debian 11), проблема в том, что я не могу установить его на Python 3.11. Я хотел использовать Python 3.11 для повышения производительности по сравнению с 3.9.
А, теперь я понимаю. Рад, что у тебя получилось.
Переустановив колесо и setuptools, я смог установить его и запустить. Я также удалил attrdict и установил только attrdict3. Итак, python -m pip uninstall attrdict attrdict3 wheel setuptools
, затем python -m pip install -U wheel setuptools
и, наконец, python -m pip install -U attrdict3
.
Насколько я понял эту ветку, нужно было удалить
attrdict
, оставив толькоattrdict3
, а затем повторить попытку.