Pyenv Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Tag: Manual revert
 
(6 intermediate revisions by the same user not shown)
Line 16: Line 16:
# The global <code>$(pyenv root)/version</code> file.
# The global <code>$(pyenv root)/version</code> file.


==<tt>pyenv</tt> and <code>brew</code>==
Also see <code>[[Pyenv_Operatons#shell|pyenv shell]]</code>, <code>[[Pyenv_Operatons#local|pyenv local]]</code>, and <code>[[Pyenv_Operatons#global|pyenv global]]</code> commands.
 
=<tt>pyenv</tt> and <tt>brew</tt>=
<code>brew</code> also lets you install different Python versions on the same system: {{Internal|Python_Versions#Python_Version_Management_with_Brew|Python Versions &#124; 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>
=What Happens if pyenv Installs a new Python Version=
<font size=-2>
pyenv install 3.9.9
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.9.tar.xz...
-> https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tar.xz
Installing Python-3.9.9...
python-build: use tcl-tk from homebrew
python-build: use readline from homebrew
python-build: use ncurses from homebrew
python-build: use zlib from xcode sdk
Installed Python-3.9.9 to /Users/ovidiu/.pyenv/versions/3.9.9
</font>

Latest revision as of 22:44, 5 April 2024

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:

  1. PYENV_VERSION
  2. The application-specific .python-version in the current directory.
  3. The first .python-version file found by searching each parent directory up to the filesystem root.
  4. The global $(pyenv root)/version file.

Also see pyenv shell, pyenv local, and pyenv global commands.

pyenv and brew

brew also lets you install different Python versions on the same system:

Python Versions | Python Version Management with Brew

TO PROCESS: https://stackoverflow.com/a/30580166

What Happens if pyenv Installs a new Python Version

pyenv install 3.9.9
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.9.tar.xz...
-> https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tar.xz
Installing Python-3.9.9...
python-build: use tcl-tk from homebrew
python-build: use readline from homebrew
python-build: use ncurses from homebrew
python-build: use zlib from xcode sdk
Installed Python-3.9.9 to /Users/ovidiu/.pyenv/versions/3.9.9