python清华镜像源地址
时间: 2023-11-27 15:44:06 浏览: 43
清华镜像源的地址是:https://pypi.tuna.tsinghua.edu.cn/simple/
如果你想使用清华镜像源,可以在 pip 安装时加上参数 -i https://pypi.tuna.tsinghua.edu.cn/simple/,例如:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ numpy
相关问题
python清华镜像源
清华大学开源软件镜像站提供了Python的镜像源,可以通过以下步骤配置:
1. 打开终端,进入/etc/apt/目录下,备份原来的sources.list文件
```
cd /etc/apt/
sudo cp sources.list sources.list.bak
```
2. 编辑sources.list文件,添加清华Python镜像源
```
sudo vim sources.list
```
在文件末尾添加以下内容:
```
# 清华Python镜像源
deb https://mirrors.tuna.tsinghua.edu.cn/python/ 宝塔版本 main
deb-src https://mirrors.tuna.tsinghua.edu.cn/python/ 宝塔版本 main
```
注意:将“宝塔版本”替换为你所使用的Ubuntu版本,例如Ubuntu 20.04对应的宝塔版本为focal。
3. 更新源并安装Python
```
sudo apt update
sudo apt install python3
```
现在你就可以使用清华Python镜像源来安装Python了。
python清华镜像源安装教程
你可以使用清华镜像源来加快使用pip命令安装Python库的速度。有两种方式可以使用清华镜像源:临时使用和永久配置。
临时使用清华镜像源的方法是在使用pip命令时添加-i参数,后面跟上清华镜像源的URL和需要下载的包的名称。例如,使用以下命令来安装torch包:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple torch [1]
永久配置清华镜像源的方法是修改pip的默认配置。你可以使用以下命令来设置全局的镜像源:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple [2]
如果你想恢复默认的镜像源,可以使用以下命令:
pip config unset global.index-url [3]
这样,你就可以使用清华镜像源来加快Python库的下载速度了。