使用 pip install 手動安裝 Python 擴展包


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: 說明擴展包或依賴已經安裝過了

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM