Here is the new workflow in place of the old popular one using
Pipenv is the central tool. pyenv provides specific version of Python (and pip) for Pipenv to initialize its virtualenv. Pipes is just a handy tool for fast navigation between Pipenv’s virtualenvs (like
workon), which may be built into Pipenv in the future.
$ brew install pyenv
eval "$(pyenv init -)" to shell (e.g.
To show available Python versions to install:
$ pyenv install --list
To install a Python version:
$ pyenv install <version>
$ brew install pipenv
To install environment with specific Python version other than system default, this version must exist in system, so we can use pyenv to install the version first, then switch to its context.
$ pyenv shell <version> $ pipenv --python <version>
After this, pyenv will be of no use because corresponding Python and pip have been installed into Pipenv’s context, unless you update to a new Python version.
To use Pipenv for an old project with
requirements.txt available, we can first
$ pipenv install
Pipfile will be automatically created from
requirements.txt, with all packages installed with specific version numbers.
$ pipenv graph
to show a dependency tree graph, from which we can identify less packages that we want. Then we can manually edit
Pipfile to keep only these key packages. Note that it does not need to make a Pipfile without any redundant (i.e. all packages are leaf nodes in the dependency tree).
pipenv install again.
Manually deleted packages in Pipfile would not be automatically uninstalled, we can use
$ pipenv clean
(Tested for ST 3)
TOMLfor TOML syntax highlighting. (Pipfile uses TOML format.)
ApplySyntaxfor custom syntax hightlighting for non-default format