pip在windows7和windows10下换源

375 阅读1分钟

​本文已参与「新人创作礼」活动,一起开启掘金创作之路。

 一、参考博客

pip在ubuntu下换源

Windows下pip换成清华源

Ubuntu pip换阿里源

二、网速对比

换源前的下载网速

2.9kB/s

换源之后的网速

换源之后的网速贼快,下载安装包巨爽,所以果断换源

1.7MB/s

三、关键步骤

(1)进入C盘下用户的文件夹 C:\Users\Administrator\AppData\Roaming,新建一个pip文件夹

(2)在该文件夹下新建一个 pip.ini 配置文件,文件内容如下: 

[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
[global]
timeout = 6000
index-url = https://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com
国内其他pip源

豆瓣 ··············· http://pypi.douban.com/
 
华中理工大学 ········ http://pypi.hustunique.com/ 
 
山东理工大学 ········ http://pypi.sdutlinux.org/ 
 
中国科学技术大学 ···· http://pypi.mirrors.ustc.edu.cn/ 
 
阿里云 ············· https://mirrors.aliyun.com/pypi/simple/  
 
清华大学 ··········· https://pypi.tuna.tsinghua.edu.cn/simple/ 
 
V2EX ··········· pypi.v2ex.com/simple
 
搜狐镜像 ··········· http://mirrors.sohu.com/Python/
 
Pypi官方  ··········· https://pypi.org/simple/

windows7系统

--【2021-4-15更新】--

windows10系统

至此,换源成功,享受高速下载体验

四、可能存在的问题

缺少系统环境变量

windows pip is configured with locations that require TLS/SSL, however the ssl module in Python i...

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
错误原因:
Anaconda 环境变量未配置完全,默认使用Anaconda3\lib\site-packages\pip。

解决办法:
D:\ProgramData\Anaconda3
D:\ProgramData\Anaconda3\Scripts
D:\ProgramData\Anaconda3\Library\bin