temporary use
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
Default
# windows系统使用cmd快速设置
pip install pip -U # 升级pip到最新版本
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Domestic Source:
The new ubuntu require the use of https source, to pay attention.
Tsinghua: https://pypi.tuna.tsinghua.edu.cn/simple
Ali cloud: http://mirrors.aliyun.com/pypi/simple/
China University of Science and Technology https://pypi.mirrors.ustc.edu.cn/simple/
Huazhong University of Science: http://pypi.hustunique.com/
Shandong University of Technology: http://pypi.sdutlinux.org/
Watercress: http://pypi.douban.com/simple/
temporary use:
-I parameter can be added when using the pip of https://pypi.tuna.tsinghua.edu.cn/simple
E.g:
the install -i PIP https://pypi.tuna.tsinghua.edu.cn/simple pyspider, which would go from Tsinghua side mirror mounting pyspider library.
Permanent changes, once and for all:
Under Linux, modify ~ / .pip / pip.conf (not just create a folder and file folders to add. "" Indicates a hidden folder)
It reads as follows:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com
windows下,在user目录中创建一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini。内容同上。