If you find you are having issues downloading with the curl command, more than likely, you have not installed the package yet. For Python 2, the pip package is available in the universe repository. Ubuntu 20.4 has only Python 3, but still requires a separate python-pip 3 installation. To install PIP2, you will need to download the. Install pip3 Ubuntu and Debian Linux Ubuntu 18.04 has both Python 2 and Python 3 installed by default, and hence has two pip variants for each Python version. Next, proceed to the Install PIP and install the corresponding version to your Python installation. Install Python 3.11: sudo apt install python3.11 -y Install Python 10: sudo apt install python3.10 -y Install Python 3.9: sudo apt install python3.9 -y
Next, you can install Python 3, which currently has a few options, most users would opt between 3.9 to 3.10, but you can install whatever version you require. Python 2 is now at the end of its life, but if you require Python2, which will use PIP2 later on, use the following command.
Next, run an APT update to reflect the imported PPA to your sources list. Sudo add-apt-repository ppa:deadsnakes/ppa -y Import Python PPAįirst, import the PPA with the following command. Currently, Ubuntu 22.04 LTS features Python 3.10, but you should import the stable PPA repository of Python to get the latest versions of not just Python 3.9 but 3.10, 3.11, and onwards.Īlso, the PPA features the last known previous Python versions for those that need a specific version. The first installation option is to install the version of Python you would like to work with. The only drawback of using PIP through PyPI is that the packages can take longer to install. For those unaware, PyPI is hosted by Python Software Foundation, a package manager that only deals with python packages that are often more updated than those hosted by Canonical through APT. APT is faster however is more outdated, whereas PIP is used to download and install packages directly from PyPI. This is a choice that every user must make. PIP VS APT Package ManagerĪ question asked regularly is whether I should use APT or PIP. It is highly recommended to use Python 3 and PIP3, and you should be upgrading to this as soon as possible. To sum it up, Pip 2 is a weak link for a particular installer running an older python version, and Pip 3 is an updated version of pip used basically for Python 3+. You will see output similar to the screenshot below. Because pip3 depends on Python 3, python3 will also be installed if it is not in your Ubuntu 20.04 system. Pip 3įor those new to the python programming language altogether, you may wonder what the difference between Pip 2 and Pip 3 is. To install pip3, run the following command.
sudo apt update & sudo apt upgrade -y Pip 2 vs.