Issue
I'm using notebooks mostly, so on the commandline I often only want to install a specific package for a specific python version I have. Currently, I usually change the global python version, run pip
and change the global version back. Is there a way to execute a single command in a specific pyenv
version?
Solution
You can override which version/environment is being used via the PYENV_VERSION environment variable
# PYENV_VERSION=2.7.15 pip install package
# PYENV_VERSION=3.6.6/some_virtualenv ipython
Answered By - nicotine Answer Checked By - Robin (WPSolving Admin)