Wiki

Clone wiki

base-environment / Pyenv

Pyenv

Installation

For Ubuntu 20.04, add this to bottom of .bashrc

# pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

and to make it work immediately without restart or restarting session:

source .bashrc

Usage looks like

In a terminal, in the root directory of the renamed repository:

$ pyenv local 3.10.0

Create virtual environment:

$ pyenv virtualenv 3.10.0 base

Activate:

$ pyenv local base

Close terminal and start IDE. Set the base interpreter in IDE.

In IDE terminal check:

$ which python
/home/nina/.pyenv/versions/3.10.0/envs/base/bin/python

Troubles

If on a Linux box in a system directory (outside of project directories) you do not get a shims path when checking path, you need to shoot these troubles. Causes can be many. If need be, create an issue.

Get the path to the python version, in my case it was:

$ which python
/home/nina/.pyenv/shims/python

Updated