Pyenv Concepts: Difference between revisions
Jump to navigation
Jump to search
pyenv and
Line 17: | Line 17: | ||
==<tt>pyenv</tt> and <code>brew</code>== | ==<tt>pyenv</tt> and <code>brew</code>== | ||
<code>brew</code> also lets you install different Python versions on the same system: {{Internal|Python_Versions#Python_Version_Management_with_Brew|Python Versions | Python Version Management with Brew}} | |||
<font color=darkkhaki>TO PROCESS: https://stackoverflow.com/a/30580166</font> | <font color=darkkhaki>TO PROCESS: https://stackoverflow.com/a/30580166</font> |
Revision as of 00:33, 3 November 2023
Internal
Overview
pyenv
is a tool that let you switch between multiple version of Python.
pyenv
lets you change the global Python version on a per-user basis. It also provides support for per-project Python versions. It allows you to override the Python version with an environment variables.
pyenv
works by intercepting Python commands using shim executables injected in PATH
, determines which Python version has been specified by your application and passes the command along to the correct Python installation.
Version Selection
The intercepting pyenv
shim determines what Python version is needed by looking at the following sources, in this order:
PYENV_VERSION
- The application-specific
.python-version
in the current directory. - The first
.python-version
file found by searching each parent directory up to the filesystem root. - The global
$(pyenv root)/version
file.
pyenv and brew
brew
also lets you install different Python versions on the same system:
TO PROCESS: https://stackoverflow.com/a/30580166