示例庫: python-ldap
系統(tǒng): Microsoft Windows [版本 10.0.18363.836]
Python版本: Python 3.7.4
pip版本: pip 20.1.1
常規(guī)流程
pip安裝: pip install python-ldap
安裝報錯, 大概意思就是缺少必須的vc++庫, 很多python庫安裝時都需要依賴vc++庫, 但是我們不需要安裝vc++庫也能解決這個問題, 就是使用.whl 文件安裝
下載最新的amd-64的whl文件, 然后使用pip install xxx.whl安裝.....
.....是不是覺得會安裝成功...too young too simple....
is not a supported wheel on this platform...平臺不支持, 那怎樣查看支持哪些平臺呢?
下面是網(wǎng)上羅列的幾種方法...
# WIN32
import pip
print(pip.pep425tags.get_supported()
報錯: AttributeError: module 'pip' has no attribute 'pep425tags'
# AMD64
import pip._internal
print(pip._internal.pep425tags.getsupported())
報錯: AttributeError: module 'pip._internal' has no attribute 'pep425tags'
然后還有這樣的...
import pip._internal.pep425tags
print(pip._internal.pep425tags.get_supported())
直接導(dǎo)包報錯...不知道那位童鞋是怎么搞定的..
最后在stackoverflow找的解決辦法
# 先安裝wheel庫
pip install wheel
# 查看支持的版本
import wheel.pep425tags as w
print(w.get_supported(archive_root=""))
再去下載對應(yīng)的包..
安裝成功...
上面的幾種寫法應(yīng)該都沒有問題, 應(yīng)該只是pip版本的問題...如果遇到類似缺少VC++庫的問題時可以都嘗試下..