Skip to content

How to use specific version of system-installed Python? #2970

Closed Answered by native-api
DUOLabs333 asked this question in Q&A
Discussion options

You must be logged in to vote

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 calls pyenv which <shim's name> to determine what real executable to run. If the selected version is system, pyenv which does that by removing shims from PATH and running command -v <shim's name> (command -v is Bash's built-in eq…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@DUOLabs333
Comment options

@native-api
Comment options

Answer selected by native-api
Comment options

You must be logged in to vote
1 reply
@native-api
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants