如何在Linux中使用python3安装wxpython ?,给我错误

时间:2019-03-29 04:28:56

标签: wxpython python-3.6 libjpeg

错误

  

正在检查GL / gl.h ...否       配置:错误:OpenGL库不可用       运行配置错误       错误:构建wxWidgets失败       追溯(最近一次通话):         文件“ build.py”,行1321,在cmd_build_wx中           wxbuild.main(wxDir(),build_options)         文件“ /tmp/pip-build-1v9li5h1/wxpython/buildtools/build_wxwidgets.py”,行   375,主要           “运行配置时出错”)         文件“ /tmp/pip-build-1v9li5h1/wxpython/buildtools/build_wxwidgets.py”,行   85,在exitIfError           引发builder.BuildError(msg)       buildtools.builder.BuildError:运行配置错误       完成的命令:build_wx(0m5.163s)       完成的命令:构建(0m5.163s)       命令'“ / usr / bin / python3” -u build.py build'失败,退出代码为1。

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1v9li5h1/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-nsn2w9dk-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-1v9li5h1/wxpython/

〜»python3

XXX-PC
Python 3.6.5 (default, May 11 2018, 13:30:17) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
 import sys
 import wx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/xxx/.local/lib/python3.6/site-packages/wx/__init__.py", line 17, in <module>
    from wx.core import *
  File "/home/xxx/.local/lib/python3.6/site-packages/wx/core.py", line 12, in <module>
    from ._core import *
  

ImportError:libjpeg.so.8:无法打开共享对象文件:否这样   文件或目录

1 个答案:

答案 0 :(得分:0)

我通常执行以下操作:

pip3 install wxPython

如果这不起作用,则您可能没有安装wxPython的依赖项之一:

我注意到在Ubuntu上有时需要安装webkit,opengl等才能安装wxPython。您的错误消息甚至提到缺少OpenGL,所以我将从此处开始。