How to use specific version of system-installed Python? #2970
-
I know that "system" can be used to tell pyenv to load what ever is the next "python" binary in the PATH. However, is there a way to use the next "python.X.Y" in the PATH? I couldn't see anything in the README about it. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
" |
Beta Was this translation helpful? Give feedback.
-
Apparently, the README addresses this concern:
So, as far as I can tell, pyenv does not have the ability to distinguish between multiple installed |
Beta Was this translation helpful? Give feedback.
Pyenv intercepts executables by creating shims (see the README).
pyenv rehash
creates shims for all executables that are installed by all Pyenv-managed versions -- which can be anything (python*
,pypy*
for PyPy,conda*
and some other utilities for Anaconda/Miniconda (with some exceptions for Anaconda); and also any executables created by installed Pip packages).Whenever you hit a shim when running a command, the shim's logic runs
exec pyenv exec
which ultimately callspyenv which <shim's name>
to determine what real executable to run. If the selected version issystem
,pyenv which
does that by removing shims from PATH and runningcommand -v <shim's name>
(command -v
is Bash's built-in eq…