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

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

posted @ 2019-07-31 06:46  仲夏之夜丶微风蝉鸣  阅读(2104)  评论(0编辑  收藏  举报