无法在Ubuntu 18.04中的Python 3.6虚拟环境中安装wxPython 4.1.0



我试图在Ubuntu 18.04操作系统中的python 3.6虚拟环境中安装runsnakerun python库。它在安装依赖项wxPython-4.1.0时给了我一个错误。

2020-08-20T17:53:47,502   Created temporary directory: /tmp/pip-wheel-vkxfnlv5
2020-08-20T17:53:47,502   Destination directory: /tmp/pip-wheel-vkxfnlv5
2020-08-20T17:53:47,502   Running command /home/poyu_kao/.virtualenvs/py36/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t25ch5cu/wxpython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t25ch5cu/wxpython/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-vkxfnlv5
2020-08-20T17:53:47,794   running bdist_wheel
2020-08-20T17:53:47,795   running build
2020-08-20T17:53:47,795   WARNING: Building this way assumes that all generated files have been
2020-08-20T17:53:47,795   generated already.  If that is not the case then use build.py directly
2020-08-20T17:53:47,795   to generate the source and perform the build stage.  You can use
2020-08-20T17:53:47,796   --skip-build with the bdist_* or install commands to avoid this
2020-08-20T17:53:47,796   message and the wxWidgets and Phoenix build steps in the future.
2020-08-20T17:53:51,080   *** Could not run GTK+ test program, checking why...
2020-08-20T17:53:51,092   *** The test program failed to compile or link. See the file config.log for the
2020-08-20T17:53:51,092   *** exact error that occurred. This usually means GTK+ is incorrectly installed.
2020-08-20T17:53:51,094   configure: error:
2020-08-20T17:53:51,094   The development files for GTK+ were not found. For GTK+ 2, please
2020-08-20T17:53:51,094   ensure that pkg-config is in the path and that gtk+-2.0.pc is
2020-08-20T17:53:51,094   installed. For GTK+ 1.2 please check that gtk-config is in the path,
2020-08-20T17:53:51,094   and that the version is 1.2.3 or above. Also check that the
2020-08-20T17:53:51,094   libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
2020-08-20T17:53:51,094   --libs' are in the LD_LIBRARY_PATH or equivalent.
2020-08-20T17:53:51,135   Error running configure
2020-08-20T17:53:51,135   ERROR: failed building wxWidgets
2020-08-20T17:53:51,136   Traceback (most recent call last):
2020-08-20T17:53:51,136     File "build.py", line 1471, in cmd_build_wx
2020-08-20T17:53:51,136       wxbuild.main(wxDir(), build_options)
2020-08-20T17:53:51,136     File "/tmp/pip-install-t25ch5cu/wxpython/buildtools/build_wxwidgets.py", line 373, in main
2020-08-20T17:53:51,136       "Error running configure")
2020-08-20T17:53:51,136     File "/tmp/pip-install-t25ch5cu/wxpython/buildtools/build_wxwidgets.py", line 85, in exitIfError
2020-08-20T17:53:51,136       raise builder.BuildError(msg)
2020-08-20T17:53:51,136   buildtools.builder.BuildError: Error running configure
2020-08-20T17:53:51,136   Finished command: build_wx (0m3.136s)
2020-08-20T17:53:51,136   Finished command: build (0m3.136s)
2020-08-20T17:53:51,143   Command '"/home/poyu_kao/.virtualenvs/py36/bin/python" -u build.py build' failed with exit code 1.
2020-08-20T17:53:51,161   ERROR: Failed building wheel for wxPython
2020-08-20T17:53:51,162   Running setup.py clean for wxPython
2020-08-20T17:53:51,162   Running command /home/poyu_kao/.virtualenvs/py36/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t25ch5cu/wxpython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t25ch5cu/wxpython/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
2020-08-20T17:53:51,390   running clean
2020-08-20T17:53:51,390   'build/lib.linux-x86_64-3.6' does not exist -- can't clean it
2020-08-20T17:53:51,390   'build/bdist.linux-x86_64' does not exist -- can't clean it
2020-08-20T17:53:51,390   'build/scripts-3.6' does not exist -- can't clean it
2020-08-20T17:53:51,406 Failed to build wxPython

然后,我尝试使用pip install wxPython安装wxPython 4.1.0,但它给了我错误。有人能帮我安装这个库吗?

最后,我使用在Python 3.6虚拟环境中成功安装了wxPython库

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

相关内容

  • 没有找到相关文章

最新更新