Pyenv is a fantastic tool for installing and managing multiple Python versions. It enables a developer to quickly gain access to newer versions of Python and keeps the system clean and free of unnecessary package bloat. It also offers the ability to quickly switch from one version of Python to another, as well as specify the version of Python a given project uses and can automatically switch to that version.
In this video, we describe how to install pyenv on Ubuntu 18.04.
apt update -y
apt 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\
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1 >/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
root@ubuntu:~# exec "$SHELL"
pyenv install --list
pyenv install 3.8.3
pyenv global 3.8.3
Video by: Justin Palmer
About the AuthorMore Content by Liquid Web