pip/pip3更換國內源
用途:pip更換為國內源,可以大大的提高安裝成功率和速度。
Windows更換pip/pip3源
- 打開目錄:%appdata%
- 新增pip文件夾,新建pip.ini文件
- 給pip.ini添加內容
[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
這個更換的是清華的源,清華的源5分鍾同步官網一次,建議使用。
注意:不管你用的是pip3還是pip,方法都是一樣的,都是創建pip文件夾。
國內源列表
清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/
阿里雲 http://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/