Как установить wxPython под альтернативную версию питона?

Я пытаюсь запустить приложение (PsychoPy) на моей Ubuntu 20.04. В связи с некоторыми техническими проблемами, мне нужно было использовать другую установку на питоне, чем моя по умолчанию. Поэтому, следуя этому руководству , я установил python 3.6 и он работает. Проблема возникла при попытке установить wxPython с питоном 3.6. Следуя другому руководству и официальному сайту wxPython, я набрал в терминале следующее:

python3.6 -m pip install --user wxpython

Казалось, что он работает, так как начал собирать колесо, но в итоге произошла ошибка. Сообщение об ошибке длинное. Последнее в отчете о сборке:

"/usr/local/bin/python3.6" /tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/bin/waf-2.0.19 --wx_config=/tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/build/wxbld/gtk3/wx-config --gtk3 --python="/usr/local/bin/python3.6" --out=build/waf/3.6/gtk3 configure build
  Setting top to                           : /tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c
  Setting out to                           : /tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/build/waf/3.6/gtk3
  Checking for 'gcc' (C compiler)          : /usr/bin/gcc
  Checking for 'g++' (C++ compiler)        : /usr/bin/g++
  Checking for program 'python'            : /usr/local/bin/python3.6
  Checking for python version >= 2.7.0     : 3.6.11
  python-config                            : /usr/local/bin/python3.6m-config
  Asking python-config for pyext '--cflags --libs --ldflags' flags : yes
  Testing pyext configuration                                      : Could not build python extensions
  The configuration failed
  (complete log in /tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/build/waf/3.6/gtk3/config.log)
  Command '"/usr/local/bin/python3.6" /tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/bin/waf-2.0.19 --wx_config=/tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/build/wxbld/gtk3/wx-config --gtk3 --python="/usr/local/bin/python3.6" --out=build/waf/3.6/gtk3 configure build ' failed with exit code 1.
  Finished command: build_py (0.795s)
  Finished command: build (4m37.280s)
  Command '"/usr/local/bin/python3.6" -u build.py build' failed with exit code 1.
  ----------------------------------------ESC[0m
ESC[31m  ERROR: Failed building wheel for wxpythonESC[0m
ESC[?25h  Running setup.py clean for wxpython
Failed to build wxpython
Installing collected packages: wxpython
    Running setup.py install for wxpython ... ESC[?25lerror
ESC[31m    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-gbhtkl1i/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/jakub/.local/include/python3.6m/wxpython

И последнее из всего лога:

Running command: build_py
    Checking for /tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/bin/waf-2.0.19...
    "/usr/local/bin/python3.6" /tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/bin/waf-2.0.19 --wx_config=/tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/build/wxbld/gtk3/wx-config --gtk3 --python="/usr/local/bin/python3.6" --out=build/waf/3.6/gtk3 configure build
    Setting top to                           : /tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c
    Setting out to                           : /tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/build/waf/3.6/gtk3
    Checking for 'gcc' (C compiler)          : /usr/bin/gcc
    Checking for 'g++' (C++ compiler)        : /usr/bin/g++
    Checking for program 'python'            : /usr/local/bin/python3.6
    Checking for python version >= 2.7.0     : 3.6.11
    python-config                            : /usr/local/bin/python3.6m-config
    Asking python-config for pyext '--cflags --libs --ldflags' flags : yes
    Testing pyext configuration                                      : Could not build python extensions
    The configuration failed
    (complete log in /tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/build/waf/3.6/gtk3/config.log)
    Command '"/usr/local/bin/python3.6" /tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/bin/waf-2.0.19 --wx_config=/tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/build/wxbld/gtk3/wx-config --gtk3 --python="/usr/local/bin/python3.6" --out=build/waf/3.6/gtk3 configure build ' failed with exit code 1.
    Finished command: build_py (0.716s)
    Finished command: build (0m1.376s)
    Command '"/usr/local/bin/python3.6" -u build.py build' failed with exit code 1.
    ----------------------------------------ESC[0m
ESC[31mERROR: Command errored out with exit status 1: /usr/local/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9uhulhbe/wxpython_053e05edce4148ecbc0f1844ca0d9b3c/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-gbhtkl1i/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/jakub/.local/include/python3.6m/wxpython Check the logs for full command output.

Что я могу сделать, чтобы wxPython был установлен под Python 3.6 в Ubuntu 20.04?

1
задан 8 April 2021 в 23:25

2 ответа

Вы можете попробовать

conda install -c asmeurer pango
0
ответ дан 23 April 2021 в 23:24

Используйте следующую команду для установки wxpython в Ubuntu 20.04:

python3 -m pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04 wxPython
0
ответ дан 23 April 2021 в 23:24

Другие вопросы по тегам:

Похожие вопросы: