To begin with, and if you do not have it enabled, you will have to enable universe repository: sudo add-apt-repository universe To install pip for Python 2 we will use the script get-pip.py. Pip for Python 2 is not included in the Ubuntu 20.04 repositories. The version number may vary, but it will look more or less as you can see in the above screenshot. When the installation is complete, we can verify installation and check installed version running the command: The above command will also install all the necessary dependencies to build Python modules. Sudo apt update & sudo apt install python3-pip If we want install pip for Python 3 on Ubuntu 20.04, we will only have to execute the following commands in a terminal (Ctrl + Alt + T): 3.3 Install packages using a requirements file.In this way, we will not have to worry about affecting other projects. Python Virtual Environments It will allow you to install Python modules in an isolated location for a specific project, instead of being installed globally. If you prefer to use Pip only in a virtual environment. ![]() It should also be clear that Python 3 packages use the prefix python3- y Python 2 packages change it to python2. When installing Python, It is strongly recommended to install the module's deb package with the apt toolas this has been tested to work properly on Ubuntu systems. Although its use is no longer recommended and users are invited to switch to Python 3. It has to be said that as of Ubuntu 20.04, Python 3 is included in the base system installation, and Python 2 is available for installation from the Universe repository. We'll also look at some of the basics of installing and managing Python packages using pip. In the following lines we are going to see how to install pip for Python 3 and Python 2 in Ubuntu 20.04. With it we will be able to search, download and install packages from Python Package Index ( P&IP) and other packet indexes. This is a tool for installing Python packages. In the next article we are going to take a look at how can we install and manage Python packages using Pip on Ubuntu 20.04.
0 Comments
Leave a Reply. |