Source: How to Install Pyenv on Ubuntu 20.04 | 22.04 | 23.04
Pyenv is an excellent tool for installing and managing several Python versions. It keeps the system tidy and clear of unused package bloat. It enables developers to access newer versions of Python smoothly. Additionally, it allows users to specify the Python version that a particular project uses. That immediately transitions to that version. It also enables easy version switching between Python versions. This guide covers installing Pyenv on Ubuntu 18.04, 20.04, and 23.04. For those interested in enhancing their server’s security setup, there’s an excellent resource. Especially on configuring firewalls in Ubuntu that you might find particularly useful.
Many people use the utility Pyenv to handle various Python versions on a single system. It enables simple installation, switching, and management. Enables many Python versions for your development projects. You can establish isolated Python environments and guarantee compatibility. Specifically with particular Python versions required by your apps by using Pyenv. You can follow the instructions in this article to install Pyenv on Ubuntu 18.04, 20.04, 22.04, 23.04.
Step-to-Step Guide for Installing Pyenv on Ubuntu 20.04 | 22.04
Step 1: Install and Update Dependencies
Starting any installation process by updating system packages is usually a good idea:
Run the following command to install all of pyenv’s dependencies after that has finished:
Step 2: In this Step, you need to Download the Script of Pyenv in Ubuntu
With the following command and the present step, download the script of Pyenv:
Step 3: Set the Environment Up
Run the following block of commands to set certain crucial environment variables and set up pyenv autocompletion in order to correctly configure pyenv for use on the system:
Finally, restart the shell by running: to begin utilizing pyenv.
Step 4: Look over the Installation
We will attempt to install a fresh copy of Python to make sure Pyenv is set up properly. The Python versions that are currently available are listed first:
The list of versions that are offered is extensive. Let’s install Python version 3.8.3 now:
If this command takes a while to execute, do not be alarmed. Pyenv is building this version of Python from the source code.
Run the pyenv versions command to see if Python 3.8.3 has now been installed:
Change Python to version 3.8.3 and then drop it into a Python shell to perform additional checking.
Commands Useful
Finally, execute the following command to get a sense of all the commands and features that pyenv has to offer:
Wrapping Up on the Installation of Pyenv on Ubuntu 20.04 | 22.04
It’s simple to manage Python versions and build isolated environments for your projects on Ubuntu 18.04 by installing pyenv. You may quickly switch between various Python versions with pyenv, ensuring flexibility and compatibility in your development workflow. You may successfully set up Pyenv and start using its capabilities to speed up your Python development process by following the instructions provided in this article.
When you conclude you will have a clear picture or concept about installing pyenv on Ubuntu on versions 18.04, 20.04, or 22.04, 23.04, etc. To manage multiple websites or database functionalities you need VestaCP to install on Ubuntu. We tried to explain to you in a simple and detailed way all the basics and steps for the installation. Hope you got things clear through this.