Skip to content

Latest commit

 

History

History
96 lines (62 loc) · 1.77 KB

72jt.md

File metadata and controls

96 lines (62 loc) · 1.77 KB

cli.py.pyenv

Manage python versions

Synopsis

  pyenv [comands]

Overview

A tool to manage python versions and change between them

Cookbook

Install pyenv

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

List and install new python versions

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

List installed python versions

You can list the versions you've already installed and are available to be used with the versions command

  pyenv versions

Unistall a version of python

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

Set a python version to use

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

Go back to the system version

If you want to go back to the system version of python

  pyenv global system