Pyenv Operatons: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 22: Line 22:


=Commands=
=Commands=
 
==<tt>versions</tt>==
List <code>pyenv</code>-managed versions:
<syntaxhighlight lang='bash'>
pyenv versions
</syntaxhighlight>
<syntaxhighlight lang='bash'>
* system (set by /Users/ovidiu/.pyenv/version)
  3.9.9
</syntaxhighlight>
==<tt>install</tt>==
==<tt>install</tt>==



Revision as of 00:58, 3 November 2023

Internal

Installation

brew install pyenv

You need to setup your shell after installation.

Setup Shell

https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenv

Bash

Add this to .bashrc:

# pyenv setup
export PYENV_ROOT="${HOME}/.pyenv"
eval "$(pyenv init -)"

Commands

versions

List pyenv-managed versions:

pyenv versions
* system (set by /Users/ovidiu/.pyenv/version)
  3.9.9

install

Installs a new Python version:

pyenv install 3.9.9

To understand what happens, see:

pyenv Concepts | What Happens if pyenv Installs a new Python Version

List of Available Python Versions

pyenv install -l

shell

Selects a pyenv-installed Python version for the current shell session:

pyenv shell 3.9.9

local

global