跳转至

pip & wheel

  • pip: The PyPA recommended tool for installing Python packages

  • wheel is the reference implementation of the Python wheel packaging standard


Install pip

Bash
python get-pip.py

配置 国内源

~/.pip/pip.conf
[global]
trusted-host =  pypi.douban.com
index-url = http://pypi.douban.com/simple

Check

Bash
python -m pip list
python -m pip show sphinx
python -m pip search "query"

Install & Uninstall

Bash
python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple <package-name>

python -m pip uninstall SomePackage
Bash
python -m pip install SomePackage-1.0-py2.py3-none-any.whl
Bash
pip install pipreqs

pip install -r requirements.txt

# export dependencies
pip freeze requirements.txt