更改pip源至清华、阿里镜像 更改pip源至清华、阿里镜像

更改pip源至清华、阿里镜像

临时使用:

可以在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple

例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gevent,这样就会从清华这边的镜像去安装gevent库。

阿里源地址为:

https://mirrors.aliyun.com/pypi/simple
  
  

永久使用:

linux下,修改 ~/.pip/pip.conf (没有就创建一个), 修改 index-url至tuna,内容如下:


  
  
  1. [global]
  2. index-url = https://pypi.tuna.tsinghua.edu.cn/simple

windows下,直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini,内容如下

 


  
  
  1.  [global]
  2.  index-url = https://pypi.tuna.tsinghua.edu.cn/simple

转载地址https://blog.csdn.net/weixin_40240670/article/details/80616834

临时使用:

猜你喜欢

转载自blog.csdn.net/qq_40663855/article/details/89671198