Install pyenv, virtualenv, and the pyenv-virtualenv plugin
I have the following in my shell to load up pyenv if i want it, this is optional and you can just always load it up if you follow the standard installation instructions:
s-pyenv() {
[[ -n "${PYENV_SHELL}" ]] && return 0
unset PYENV_VERSION || true
if [[ -d "$HOME/.pyenv" ]]; then
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
fi
if which 'pyenv' &>/dev/null; then
eval "$(pyenv init -)"
[[ -n "$PYENV_VIRTUALENV_INIT" ]] && return 0
if which 'pyenv-virtualenv-init' &>/dev/null; then
eval "$(pyenv virtualenv-init -)"
fi
fi
}
install a python version:
$ pyenv install --list |less
$ pyenv install 3.7.1
create a virtualenv for the python version you just installed
$ pyenv virtualenv 3.7.1 project-name
activate that environment for the current shell
$ pyenv shell project-name
now run pip to install whatever you need and it will be placed in the virtualenv for that version of python
$ pip install jupyter
to list your virtualenvs:
$ pyenv versions