Python pip临时指定源下载和永久修改下载源

Python pip临时指定源下载

文章目录

  • Python pip临时指定源下载
  • 永久修改pip下载源(修改为阿里云)
      • MAC/Liunx
  • 更新pip

#阿里云
pip install flask -i https://mirrors.aliyun.com/pypi/simple/
#豆瓣
pip install flask -i https://pypi.douban.com/simple/
#清华
pip install flask -i https://pypi.tuna.tsinghua.edu.cn/simple/

永久修改pip下载源(修改为阿里云)

MAC/Liunx

# 新建文件夹
mkdir ~/.pip
cat >> ~/.pip/pip.conf <<  EOF
[list]
format = columns
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
use-mirrors = true
mirrors = https://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com
EOF

更新pip

python3.7 -m pip install --upgrade pip

你可能感兴趣的:(Python,python,pip,flask)