最近需要安裝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
如圖所示:
不容易啊,總算安裝成功了