How to Install Pyenv on Ubuntu 18.04

June 11, 2020 Liquid Web

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.

Commands used:
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

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 versions
pyenv global 3.8.3
python
pyenv help

Video by: Justin Palmer

About the Author

Liquid Web

Liquid Web powers online content, commerce, and potential for SMB entrepreneurs and the designers, developers and digital agencies who create for them. Sign up for our newsletter to stay up to date with our latest content.

More Content by Liquid Web
Previous Video
Modifying Fields in Database Tables Using PhpMyAdmin
Modifying Fields in Database Tables Using PhpMyAdmin

In this video, we describe how to modify fields in a database table via PhpMyAdmin.

Next Video
How to Install and Configure Apache Maven on Ubuntu 18.04
How to Install and Configure Apache Maven on Ubuntu 18.04

In this video, we describe how to install and configure Apache Maven on Ubuntu 18.04.

Learn What Qualities to Look for in Your Next Host in Our New Guide!

Download Now