basic pip
pip install some-package
Specify version pip
pip install some-package==2.3.4
Upgrade the latest version package pip
pip install --upgrade some-package
Upgrade the specified version package pip
pip install --upgrade some-package==2.3.4
with temporary source pip
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
Configure pip permanent source
Under Linux, modify ~/.pip/pip.conf (if not, create a folder and file. Add "." to the folder to indicate that it is a hidden folder) as follows
:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
Under windows, create a pip directory directly in the user directory, such as: C:\Users\xx\pip, and then create a new file pip.ini, namely %HOMEPATH%\pip\pip.ini, enter the following in the pip.ini file Content (Take Douban Mirror as an example):
[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host = pypi.douban.com
Among them, the more commonly used domestic mirrors include:
(1) Alibaba Cloud http://mirrors.aliyun.com/pypi/simple/
(2) Douban http://pypi.douban.com/simple/
(3) Tsinghua University https ://pypi.tuna.tsinghua.edu.cn/simple/
(4) University of Science and Technology of China http://pypi.mirrors.ustc.edu.cn/simple/
(5) Huazhong University of Science and Technology http://pypi. hustunique.com/