Pyenv Operatons: Difference between revisions
Jump to navigation
Jump to search
Line 76: | Line 76: | ||
==<tt>pyenv: version '...' is not installed</tt>== | ==<tt>pyenv: version '...' is not installed</tt>== | ||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
pyenv install | pyenv install 3.12.2 | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 22:46, 5 April 2024
Internal
Installation
brew install pyenv
You need to setup your shell after installation.
Setup Shell
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:
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
pyenv local 3.9.9
It sets a directory-specific Python version by writing the .python-version
file in the directory:
3.9.9
global
root
Lists the content of PYENV_ROOT
environment variable:
pyenv root
Troubleshooting
pyenv: version '...' is not installed
pyenv install 3.12.2