pip操作

永久设置镜像

设置阿里云的镜像

1
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

设置清华大学的镜像

1
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

查看是否设置成功

1
pip config list

临时更换镜像

例如下载requests包,版本号之类的

1
pip install requests -i https://mirrors.aliyun.com/pypi/simple/

在需要下载的包后面加上

1
-i https://mirrors.aliyun.com/pypi/simple/

查看安装的包的版本

1
2
 pip index versions [your python module name]
#[your python module name]换成你要找的包名

然后就可以下载一个需要的版本,例如\(tensorflow\)

1
pip install tensorflow==2.12.2

pip操作
https://rain_dew.gitee.io/2024/04/25/其他/pip操作/
Author
Wang yulu
Posted on
April 25, 2024
Licensed under