无法使用 pip3 在带有 python3.7 的 Ubuntu 上安装 wxPython [英] unable to install wxPython on Ubuntu with python3.7 using pip3

查看:54
本文介绍了无法使用 pip3 在带有 python3.7 的 Ubuntu 上安装 wxPython的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须安装 wxPython.

我有,

  • Ubuntu 18.10
  • python 版本:Python 3.7.3
  • pip3 版本:pip 19.0.3

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

from /usr/local/lib/python3.7/site-packages/pip (python 3.7) I run command,

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 配置构建设置顶部为:/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.3python-config:/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.完成命令:build_py (0.852s)完成命令:build (2m51.322s)命令 '"/usr/local/bin/python3.7" -u build.py build' 失败,退出代码为 1.

Checking for /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 Setting top to : /tmp/pip-install-mjeu3aw7/wxpython Setting out to : /tmp/pip-install-mjeu3aw7/wxpython/build/waf/3.7/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.7 Checking for python version >= 2.7.0 : 3.7.3 python-config : /usr/local/bin/python3.7-config Asking python-config for pyembed '--cflags --libs --ldflags' flags : yes Testing pyembed configuration : yes 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-mjeu3aw7/wxpython/build/waf/3.7/gtk3/config.log) Command '"/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) Finished command: build (2m51.322s) Command '"/usr/local/bin/python3.7" -u build.py build' failed with exit code 1.

---------------------------------------- 命令 "/usr/local/bin/python3.7 -u -c "导入设置工具,tokenize;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/

---------------------------------------- Command "/usr/local/bin/python3.7 -u -c "import setuptools, tokenize;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" failed with error code 1 in /tmp/pip-install-mjeu3aw7/wxpython/

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

Can anybody give me the exact installation working solutions or how to proceed?

提前致谢.

推荐答案

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

wxPython does not natively support wheels building for Linux.

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

If you're on Ubuntu, try the following according to their documentation:

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

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

If you're not on any of the supported extras or the above doesn't work, you'll have to build it yourself according to their directions on their Downloads page.

这篇关于无法使用 pip3 在带有 python3.7 的 Ubuntu 上安装 wxPython的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆