pip用法
# ubuntu安装pip
python2:sudo apt-get install python-pip
python3:sudo apt-get install python3-pip
# 如果提示错误 E:Unable to locate package python3-pip
apt-get update
1
2
3
4
5
2
3
4
5
# 安装时指定镜像源
临时指定安装源 https://www.cnblogs.com/yigui/p/11863313.html
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
1
2
3
2
3
永久修改安装源: https://blog.csdn.net/su4416160/article/details/81742367 (opens new window)
[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
输入以下内容
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
1
2
3
2
3
# pip升级
python -m pip install --upgrade pip
python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
-i https://pypi.tuna.tsinghua.edu.cn/simple
编辑 (opens new window)
上次更新: 2021/10/11, 12:43:58