Pyenv to manage multiple versions of python
Similar to nvm for managing node versions, penv allows you to install and move between different versions of python.
Full instructions are here, but a simple introduction (for Ubuntu on WSL) is given here.
Install the dependencies:
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl
Instlal pyenv and add it to your path according to your system specific instructions given in the console:
curl https://pyenv.run | bash
Then to list version of python that are installed use:
pyenv versions
The * in the listing shows which one is currently active.
To install another use:
pyenv install 3.8.13
To make a specific python version active in the current directory use:
pyenv local 3.8.13
For the global setting use:
pyenv global 3.8.13
Also make sure you don't have any alias stuff messing up the names for python.
Comments
Post a Comment