Ubuntu20安装wxPython

centos7/Ubuntu20,python版本3.8,需要安装robotframework-ride 或者 wxPython

在安装wxpython时报错,切换python版本,使用pip或手动安装wxpython都出现如下错误:

    copying wx/html2.pyi -> build/lib.linux-x86_64-3.8/wx
    copying symlink wx/libwx_baseu-3.0.so -> build/lib.linux-x86_64-3.8/wx/libwx_baseu-3.0.so
    error: [Errno 2] No such file or directory: 'build/lib.linux-x86_64-3.8/wx/libwx_baseu-3.0.so'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-p1agpt0t/wxPython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-p1agpt0t/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-0tmrq3qv/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/wxPython Check the logs for full command output.       

python3.8默认的setuptools都是50左右的版本,将setuptools回退到41.0.1可以解决问题。

pip install setuptools==41.0.1

pip install wxPython==4.0.7 或者pip install robotframework-ride

另外还需安装下面的工具与开发包:

apt install make gcc libgtk-3-dev libgstreamer-gl1.0-0 freeglut3 freeglut3-dev python3-gst-1.0 libglib2.0-dev ubuntu-restricted-extras libgstreamer-plugins-base1.0-dev build-essential

你可能感兴趣的:(UNIX,Linux,python,python,开发语言)