Summary of common operations of PIP

1. Upgrade

python -m pip install --upgrade pip

2. List all installation packages

pip list

3. Find a specific package

pip list | findstr xxx

4. View a specific package

pip show xxx

5. Install the package

pip install pyzmq==24.0.1

6. Uninstall the package

pip uninstall -y pyzmq

7. View configuration

# 生效的配置(global -> user -> site三层配置叠加(后面的覆盖前面的)后配置)
pip config list
# 仅查看global level的配置
pip config list --global
# 仅查看user level的配置
pip config list --user
# 仅查看site level(虚拟环境)的配置
pip config list --site

8. Configuration

Take the global level as an example:

# 检查当前配置
pip config --global list
# 重新配置
pip config --global set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config --global set install.trusted-host mirrors.aliyun.com
# 再次检查当前配置
pip config --global list

Guess you like

Origin blog.csdn.net/bluishglc/article/details/132411461