The Use of pip in python and the Method of Modifying Download Source
- 2021-07-10 20:28:03
- OfStack
Basic command
Display version information
pip -V
Install the specified package
pip install <packages>
pip install -i 'host' <packages> Specify the download source
Uninstall the specified package
pip uninstall <packages>
List installed packages
pip list
Displays information about installed packages
pip show <packages>
Find the specified package
pip search
Modify the download source
Linux
vim ~/.pip/pip.conf # Edit the hidden configuration file in the user directory, if not, generate it 1 A
The format is as follows:
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
The modification method of window is similar to that of Linux, just edit pip. conf in the user directory, such as C:\ Users\ username\ AppData\ Local\ pip
Domestic source
Tsinghua: https://pypi.tuna.tsinghua.edu.cn/simple
Alibaba Cloud: http://mirrors.aliyun.com/pypi/simple/
University of Science and Technology of China https://pypi.mirrors.ustc.edu.cn/simple/
Huazhong University of Science and Technology: http://pypi.hustunique.com/
Shandong University of Technology: http://pypi.sdutlinux.org/
Douban: http://pypi.douban.com/simple/