pip install命令安裝擴展庫整理
pip install命令用于安裝擴展庫,由于安裝擴展庫需要從國外網(wǎng)站下載,速度較慢,可以使用-i選項設置臨時使用國內(nèi)的鏡像網(wǎng)站。
命令格式:
pip install -i 鏡像地址 包名
例如:
pip install -i http://pypi.douban.com/simple/ django
常用國內(nèi)鏡像地址:
清華大學:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云:https://mirrors.aliyun.com/pypi/simple/
豆瓣網(wǎng):https://pypi.douban.com/simple/
中國科技大學:https://pypi.mirrors.ustc.edu.cn/simple/
使用pip install命令時,如果出現(xiàn)“WARNING: The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with ‘–trusted-host pypi.douban.com'.”安裝錯誤問題:

解決辦法:
(1)可以使用參數(shù)–trusted-host指定可信任的主機
pip install -i http://pypi.douban.com/simple django --trusted-host=pypi.douban.com

安裝成功后,可以用pip list查看包列表驗證一下。

(2)不用參數(shù)–trusted-host,把http換成https。
pip install -i https://pypi.douban.com/simple django
試一下,先刪除已安裝的django包
pip uninstall django


安裝成功。
到此這篇關(guān)于pip install命令安裝擴展庫整理的文章就介紹到這了,更多相關(guān)pip install命令內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
TensorFlow實現(xiàn)保存訓練模型為pd文件并恢復
今天小編就為大家分享一篇TensorFlow實現(xiàn)保存訓練模型為pd文件并恢復,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-02-02
python中單例常用的幾種實現(xiàn)方法總結(jié)
Python 的模塊就是天然的單例模式,下面這篇文章主要給大家介紹了關(guān)于python中單例常用的幾種實現(xiàn)方法,文中通過示例代碼介紹的非常詳細,對大家學習或者使用python單例具有一定的參考學習價值,需要的朋友們一起來看看吧2018-10-10
python小程序基于Jupyter實現(xiàn)天氣查詢的方法
這篇文章主要介紹了python小程序基于Jupyter實現(xiàn)天氣查詢的方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-03-03

