Linux中将pip 源切换至国内镜像~亲测可用
生活随笔
收集整理的這篇文章主要介紹了
Linux中将pip 源切换至国内镜像~亲测可用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
- 在Linux中使用pip下載python第三方包時太慢了,記錄一個使用 pip 安裝軟件時,使用國內鏡像可以大大提高下載速度的方法。
常用的國內鏡像
-
- https://pypi.tuna.tsinghua.edu.cn/simple/ 清華大學
-
- https://mirrors.aliyun.com/pypi/simple/ 阿里云
臨時使用
pip install 添加 -i 參數指定源
- 例如:
- pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ numpy
永久使用
- 在用戶的根目錄下創建 .pip 文件夾,新建 pip.conf 文件
cd ~
mkdir .pip
cd .pip
vim pip.conf - 在文件中寫入要使用的鏡像
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
總結
以上是生活随笔為你收集整理的Linux中将pip 源切换至国内镜像~亲测可用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: live555推流rtsp_Hi3518
- 下一篇: 怎么从mysql注册表删除用户_mysq