Manage python versions
pyenv [comands]
A tool to manage python versions and change between them
You first need to install the dependencies for your plataform. In the case of
Arch
linux. Or visit the wiki
pacman -S --needed base-devel openssl zlib xz
To install pyenv use the installer
curl https://pyenv.run | bash
You can use the install
comand to list and install python versions
pyenv install --list # List all available versions
To list a specific version of python that you are looking for use grep
.
In this example we use it to find what available versions of python between 3.6 and 3.8
pyenv install --list | grep " 3\.[678]"
Once you've found the version you want install it with the -v
flag
pyenv install -v 3.8.2
You can list the versions you've already installed and are available to be used
with the versions
command
pyenv versions
You can uninstall a version of python by:
- Going to the instalation directory and removing the corresponding directory
- Using the
unistall
comand
pyenv unistall 3.8.2
If you want to use a python version you can set it globaly by usign the
global
comand
pyenv global 3.8.2
You can set a local project python version with the local
comand
pyenv local 3.8.2
If you want to go back to the system version of python
pyenv global system