首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在另一个python版本下安装wxPython?

如何在另一个python版本下安装wxPython?
EN

Ask Ubuntu用户
提问于 2021-04-08 20:25:04
回答 2查看 2.5K关注 0票数 0

我正在我的Ubuntu20.04上运行一个应用程序(PsychoPy)。由于一些技术问题,我需要使用一个不同于默认的python安装。因此,在本指南之后,我安装了python3.6,它可以工作。当我试图用python3.6安装wxPython时,出现了这个问题。在另一个向导和官方wxPython网站之后,我输入了以下内容:

代码语言:javascript
复制
python3.6 -m pip install --user wxpython

它似乎工作,因为它开始建造车轮,但它的结果是一个错误。错误信息很长。构建报告中的最后一件事是:

代码语言:javascript
复制
"/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

整个日志里最后一件事是:

代码语言:javascript
复制
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.

在Ubuntu20.04中如何在Python3.6下安装wxPython?

EN

回答 2

Ask Ubuntu用户

发布于 2021-04-08 20:37:41

使用以下命令在Ubuntu20.04上安装wxpython

代码语言:javascript
复制
python3 -m pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04 wxPython
票数 1
EN

Ask Ubuntu用户

发布于 2021-04-19 11:58:20

你也许想试试

代码语言:javascript
复制
conda install -c asmeurer pango
票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1330171

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档