首页 > 解决方案 > 无法使用 pip3 在带有 python3.7 的 Ubuntu 上安装 wxPython

问题描述

我必须安装wxPython

我有,

从 /usr/local/lib/python3.7/site-packages/pip (python 3.7) 我运行命令,

pip3 install wxPython

它通过以下错误:

检查 /tmp/pip-install-mjeu3aw7/wxpython/bin/waf-2.0.8... "/usr/local/bin/python3.7" /tmp/pip-install-mjeu3aw7/wxpython/bin/waf- 2.0.8 --wx_config=/tmp/pip-install-mjeu3aw7/wxpython/build/wxbld/gtk3/wx-config --gtk3 --python="/usr/local/bin/python3.7" --out= build/waf/3.7/gtk3 configure build 设置顶部为:/tmp/pip-install-mjeu3aw7/wxpython 设置为:/tmp/pip-install-mjeu3aw7/wxpython/build/waf/3.7/gtk3 检查“gcc” (C 编译器):/usr/bin/gcc 检查“g++”(C++ 编译器):/usr/bin/g++ 检查程序“python”:/usr/local/bin/python3.7 检查 python 版本 >= 2.7.0:3.7.3 蟒蛇配置:/usr/local/bin/python3.7-config 向 python-config 询问 pyembed '--cflags --libs --ldflags' 标志:是 测试 pyembed 配置:是 向 python-config 询问 pyext '--cflags --libs --ldflags'标志:是测试pyext配置:无法构建python扩展配置失败(完成登录/tmp/pip-install-mjeu3aw7/wxpython/build/waf/3.7/gtk3/config.log)命令'“/ usr/local/bin/python3.7" /tmp/pip-install-mjeu3aw7/wxpython/bin/waf-2.0.8 --wx_config=/tmp/pip-install-mjeu3aw7/wxpython/build/wxbld/gtk3/wx -config --gtk3 --python="/usr/local/bin/python3.7" --out=build/waf/3.7/gtk3 configure build ' failed with exit code 1. Finished command: build_py (0.852s)完成的命令:构建(2m51.322s)命令'“/usr/local/bin/python3.7”-u build.py build'失败,退出代码为1。

---------------------------------------- 命令“/usr/local/bin/python3 .7 -u -c "导入设置工具,标记化;file ='/tmp/pip-install-mjeu3aw7/wxpython/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-o0jpf739/install-record.txt --single- version-externally-managed --compile" 失败,错误代码 1 在 /tmp/pip-install-mjeu3aw7/wxpython/

谁能给我确切的安装工作解决方案或如何进行?

提前致谢。

标签: wxpythonpython-3.7

解决方案


wxPython 本身并不支持为 Linux 构建轮子。

如果您使用的是 Ubuntu,请根据他们的文档尝试以下操作:

pip install -U \
    -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 \
    wxPython

如果您没有使用任何受支持的附加功能或上述内容不起作用,则必须根据他们在下载页面上的说明自行构建。


推荐阅读