0、查看 pip install [options]
打開控制台或終端,在命令提示符后輸入
/> pip install --help
可以查看安裝選項都有哪些,在此我們只需關注以下兩個
Package Index Options:
-i, --index-url <url> Base URL of the Python Package Index (default https://pypi.org/simple). This should point to a repository
compliant with PEP 503 (the simple repository API) or a local directory laid out in the same format.
General Options:
-h, --help Show help.
下面的url是清華大學的,以此為例
https://pypi.tuna.tsinghua.edu.cn/simple/
可以試着打開上面的鏈接,通俗來講你看到的就是某台電腦上的某些目錄結構
1、從指定的url資源鏡像地址下載需要的擴展包,指定url下載可以提高下載速度及下載成功率,畢竟指定的資源就存放在國內
2、從缺省的url資源鏡像地址下載需要的擴展包,即官方網站提供的,也是常規的下載方案
3、看到 Requirement already satisfied: 說明擴展包或依賴已經安裝過了