最近需要安装wxPython,熟练的在命令行窗口用pip install wxPython安装,试了好几次一直,报错
然后尝试去官网下载源文件,再安装
下载完源文件,在命令行窗口python的安装目录/Scripts下执行pip install wxPython-4.1.0-cp37-cp37m-win_amd64.whl
报错:ERROR: wxPython-4.1.0-cp37-cp37m-win_amd64.whl is not a supported
然后,在网上搜索这个报错的解决问题,看到各位大佬说:在shell中输入import pip; print(pip.pep425tags.get_supported())可以获取到pip支持的文件名还有版本
输入 print(pip.pep425tags.get_supported())命令,报错:AttributeError: module 'pip' has no attribute 'pep425tags'
继续找其他大佬的解决办法:在shell中输入import pip._internal 和print(pip._internal.pep425tags.get_supported())可以获取到pip支持的文件名还有版本
继续操作,报错:AttributeError: module 'pip._internal' has no attribute 'pep425tags'
好吧,开始怀疑人生了,怎么报错越来越多了
继续找其他大佬的说法,18.0以上的pip这两个是行不通的,OK
继续尝试:用python -m pip debug --verbose这个命令试试
总算不报错了:(运行结果如下)
pip version: pip 20.2.1 from C:\python\lib\site-packages\pip (python 3.7)
sys.version: 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)]
sys.executable: C:\python\python.exe
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: utf-8
locale.getpreferredencoding: cp936
sys.platform: win32
sys.implementation:
name: cpython
'cert' config value: Not specified
REQUESTS_CA_BUNDLE: None
CURL_CA_BUNDLE: None
pip._vendor.certifi.where(): C:\python\lib\site-packages\pip\_vendor\certifi\cacert.pem
pip._vendor.DEBUNDLED: False
vendored library versions:
appdirs==1.4.4
CacheControl==0.12.6
colorama==0.4.3
contextlib2==0.6.0.post1 (Unable to locate actual module version, using vendor.txt specified version)
distlib==0.3.1
distro==1.5.0 (Unable to locate actual module version, using vendor.txt specified version)
html5lib==1.1
ipaddress==1.0.23
msgpack==1.0.0 (Unable to locate actual module version, using vendor.txt specified version)
packaging==20.4
pep517==0.8.2
progress==1.5
pyparsing==2.4.7
requests==2.24.0
certifi==2020.06.20
chardet==3.0.4
idna==2.10
urllib3==1.25.9
resolvelib==0.4.0
retrying==1.3.3 (Unable to locate actual module version, using vendor.txt specified version)
setuptools==44.0.0 (Unable to locate actual module version, using vendor.txt specified version)
six==1.15.0
toml==0.10.1
webencodings==0.5.1 (Unable to locate actual module version, using vendor.txt specified version)
Compatible tags: 27
cp37-cp37m-win32
cp37-abi3-win32
cp37-none-win32
cp36-abi3-win32
cp35-abi3-win32
cp34-abi3-win32
cp33-abi3-win32
cp32-abi3-win32
py37-none-win32
py3-none-win32
py36-none-win32
py35-none-win32
py34-none-win32
py33-none-win32
py32-none-win32
py31-none-win32
py30-none-win32
cp37-none-any
py37-none-any
py3-none-any
py36-none-any
py35-none-any
py34-none-any
py33-none-any
py32-none-any
py31-none-any
py30-none-any
总算查看到了本机pip支持的文件名还有版本
修改wxPython-4.1.0-cp37-cp37m-win_amd64.whl文件名字为wxPython-4.1.0-cp37-cp37m-win32.whl
在命令行窗口python的安装目录/Scripts下执行pip install wxPython-4.1.0-cp37-cp37m-win32.whl
如图所示:
不容易啊,总算安装成功了