pip install命令安裝擴展庫整理
pip install命令用于安裝擴展庫,由于安裝擴展庫需要從國外網(wǎng)站下載,速度較慢,可以使用-i選項設(shè)置臨時使用國內(nèi)的鏡像網(wǎng)站。
命令格式:
pip install -i 鏡像地址 包名
例如:
pip install -i http://pypi.douban.com/simple/ django
常用國內(nèi)鏡像地址:
清華大學(xué):https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云:https://mirrors.aliyun.com/pypi/simple/
豆瓣網(wǎng):https://pypi.douban.com/simple/
中國科技大學(xué):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)文章
Python實現(xiàn)求解斐波那契第n項的解法(包括矩陣乘法+快速冪)
這篇文章主要介紹怎么使用Python求解斐波那契第n項,方法多樣,邏輯清晰,代碼簡單詳細,有這方面需要的朋友可以參考下2021-04-04Python進行數(shù)據(jù)科學(xué)工作的簡單入門教程
這篇文章主要介紹了Python進行數(shù)據(jù)科學(xué)工作的簡單入門教程,主要針對Python發(fā)行版Anaconda進行說明,需要的朋友可以參考下2015-04-04