Nvidia Jetson TX2開發板學習歷程( 2 )- 更換pip源,提高下載速度


通過將pip的源更換為國內源,來提高下載速度,這也將成為今后學習過程下載Python包的基礎,建議前期一定要完成!

知名的國內源

清華:https://pypi.tuna.tsinghua.edu.cn/simple
阿里雲:http://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
華中理工大學:http://pypi.hustunique.com/
山東理工大學:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/

需要注意的是新版的ubuntu要求使用http源。

使用方法

臨時修改

使用pip install的 -i 命令進行設置,格式如下:

-i https://pypi.tuna.tsinghua.edu.cn/simple

例如:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider

永久修改

通過編輯pip的配置文件進行設置,方法如下:

在linux中,修改 ~/.pip/pip.config(如果沒有就自行創建,格式和前面的必須完全一致)。

添加內容如下:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com

添加其他源,格式與上面的類似依次類推即可。


免責聲明!

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



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