使用linux或macos操作系统,通过pip install wxPython直接安装,务必会出现错误,那这类错误怎么处理呢?
pip安装wxPython的错误
使用pip instal wxPython
安装wxPython
,错误如下:
buildtools.builder.BuildError: Error running configure
Finished command: build_wx (0.544s)
Finished command: build (0.544s)
Command '"/home/xxx/Envs/globalweb-apitest/bin/python38" -u build.py build' failed with exit code 1.
----------------------------------------
ERROR: Command errored out with exit status 1: /home/xxx/Envs/globalweb-apitest/bin/python38 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ckcqape3/wxPython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ckcqape3/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-uybwyt5t/install-record.txt --single-version-externally-managed --compile --install-headers /home/xxx/Envs/globalweb-apitest/include/site/python3.8/wxPython Check the logs for full command output.
解决方法
访问wxPython官网,下载需要的版本
下载下来后,通过pip install xxx.whl
安装即可**(如果本地有虚拟环境,务必先生效虚拟环境,再安装)**