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

Я пытаюсь запустить приложение (PsychoPy) на моем Ubuntu 20.04. Из-за некоторых технических проблем мне пришлось использовать другую установку Python, чем моя установка по умолчанию. Итак, следуя этому руководству, я установил python 3.6, и он работает. Проблема возникла, когда я пытался установить wxPython с python 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?

2 ответа

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

      python3 -m pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04 wxPython

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

      conda install -c asmeurer pango
Другие вопросы по тегам