Could not find a version that satisfies the requirement lxml解決方法

  • 2020 年 2 月 25 日
  • 筆記

今天ytkah在安裝lxml時提示錯誤ERROR: Could not find a version that satisfies the requirement lxml (from versions: none),ERROR: No matching distribution found for lxml,升級一下pip試試

python -m pip install --upgrade pip

  再次安裝lxml還是錯誤,考慮到是網路不穩定的問題,這時我們用中國的鏡像源來加速

pip install 包名-i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

  –trusted-host pypi.douban.com 這是為了獲得ssl證書的認證

執行成功!

不過每次這樣手動輸入會比較麻煩,建議每次換系統時先換成中國的鏡像源,具體配置請參考https://blog.csdn.net/u012592062/article/details/51966649