PyPI
a repository of software for the Python programming language
pip
Install pip
- curl https://bootstrap.pypa.io/get-pip.py, download pip
- python get-pip.py
- pip install -U pip, update pip to the current version
pip list
- pip list, list the installed packages
- pip list --outdated, list the outdated packages
pip show [packagename], show the information of an installed package
pip search [packagename], show available package from PyPI repository
pip install
- pip install [packagename], install a package
- pip install --upgrade [packagename], upgrade a package
pip uninstall [packagename], uninstall a package
config
- ~/.pip/pip.conf
- index-url = http://pypi.douban.com/simple, add third-party repository
pip freeze > requirements.txt, export installed packages in requirements format
pip install -r requirements.txt, install the modules with the requirements file
pip wheel, reduce the time of compiling when installing multiple times on the different virtual environments
- pip install package.whl, install a package from .whl file
- pip wheel --wheel-dir=[directoryname] [packagename], download the .whl file of the specific package to a directory
- pip install --use-wheel --no-index --find-links=[directoryname] [packagename], install a package from the downloaded .whl file
- pip install --use-wheel --no-index --find-links=https://wheelhouse.example.com/ pyramid, install from cached wheels remotely
virtualenv
pip install virtualenv, install virtualenv
virtualenv [environmentName]
- virtualenv -p /usr/bin/python2.7 [environmentName], use the Python interpreter of your choice
source [environmentName]/bin/activate, activate the virtual environment
deactivate, deactivate the virtual environments
Reference