python pip and pipenv

Author: yifei / Created: May 30, 2017, 11:04 a.m. / Modified: May 30, 2017, 11:08 a.m. / Edit

pip is python's package manage tool.

installing packages

to install a package from PyPI:

pip install <package-name>==<version>, version is optional

To install a package from git repository:

pip install -e git+REPO

pip currently supports cloning over git, git+https and git+ssh:

Here are the supported forms:

[-e] git+git://
[-e] git+
[-e] git+ssh://  # for private repo, you can only use this

Passing branch names, a commit hash or a tag name is possible like so:
[-e] git://
[-e] git://
[-e] git://

if you add the -e(editable) option, then you can save the version info in freeze, which is exactly what you need.

upgrade a package:

pip install package-name --upgrade

requirements file

save current dependencies to a requirement file:

pip freeze > requirements.txt

install from a requirement file

pip install -r requirements.txt

pipenv seems to be the best tool for now, read it here: