{"id":15653,"date":"2021-12-10T13:30:14","date_gmt":"2021-12-10T13:30:14","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=15653"},"modified":"2026-03-10T10:06:44","modified_gmt":"2026-03-10T10:06:44","slug":"install-pip-ubuntu","status":"publish","type":"post","link":"\/my\/tutorials\/install-pip-in-ubuntu\/","title":{"rendered":"How to Install Python pip on Ubuntu"},"content":{"rendered":"<p>pip, stands for pip Installs Packages, is a package management system for installing Python dependencies. Unlike Linux&rsquo;s default software manager, this tool has additional features that make it more flexible and reliable.<\/p><p>For example, pip uses a more comprehensive repository and has dependency resolution to ensure compatibility. This makes pip the preferred tool for managing software during Python project deployment.<\/p><p>This article will explain how to install pip on an Ubuntu virtual private server (VPS) and the basic pip commands for managing Python packages on your system.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Linux-Commands-Cheat-Sheet.pdf\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" width=\"1024\" height=\"283\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet-1024x283.png\" alt=\"\" class=\"wp-image-69262\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2022\/11\/Linux-cheat-sheet-1536x425.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2022\/11\/Linux-cheat-sheet-300x83.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2022\/11\/Linux-cheat-sheet-150x41.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2022\/11\/Linux-cheat-sheet-768x212.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2022\/11\/Linux-cheat-sheet.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>\n\n\n<div class=\"protip\">\n                    <h2 class=\"featured-snippet title\">What is pip?<\/h2>\n                    <p>pip Installs Packages (pip) is a Python package manager for installing, updating, and removing modules. It lets you select a specific software version, isolate packages in Python virtual environments, and automatically check dependencies. Due to its benefits, pip is the top software for <a href=\"\/my\/tutorials\/how-to-create-a-python-virtual-environment\">setting up a hosting environment for Python projects<\/a>.<\/p>\n                <\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-prerequisites-for-installing-pip-on-ubuntu\">Prerequisites For Installing pip on Ubuntu<\/h2><p>Before proceeding with the steps, ensure you have a VPS running a newer version of the Ubuntu operating system, like <strong>22.04<\/strong>. Otherwise, the installation commands might be different.<\/p><p><a href=\"\/my\/vps-hosting\">Hostinger&rsquo;s VPS hosting<\/a> supports various operating systems and software, ensuring smooth pip installation and Python deployment processes.<\/p><p>Users can set up Linux distros and applications in one click using our <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1583571-what-are-the-available-operating-systems-for-vps\" target=\"_blank\" rel=\"noopener\">VPS operating system templates<\/a>. For example, they can use the <strong>Ubuntu 22.04 with Django<\/strong> template to speed up the Python deployment.<\/p><p>Other features also help simplify other server management tasks. The <strong>Browser Terminal<\/strong> lets you connect to the VPS directly from your web browser. You can also generate commands for server administration using simple prompts with <a href=\"\/blog\/vps-ai-assistant\">Kodee, our AI Assistant<\/a>.<\/p><p>Our VPS plans are suitable for beginners with minimal technical knowledge and experts who require full control over their hosting environment.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/my\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner-1024x300.png\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-how-to-install-pip-on-ubuntu\">How to Install pip on Ubuntu<\/h2><p>After purchasing a Hostinger VPS hosting plan and installing <strong>Ubuntu 22.04<\/strong>, follow these steps to install pip.<\/p><h3 class=\"wp-block-heading\" id=\"h-1-connect-to-your-vps-and-create-a-new-account\">1. Connect to Your VPS and Create a New Account<\/h3><p>To run commands on your VPS, connect to the system via the secure shell (SSH) protocol.<\/p><p><strong>Linux <\/strong>or <strong>macOS <\/strong>users can use <strong>Terminal<\/strong>. However, in this tutorial, we will <a href=\"\/my\/tutorials\/how-to-use-putty-ssh\">use the PuTTY client<\/a> since it is also compatible with other operating systems, including <strong>Windows<\/strong>.<\/p><p>After installing PuTTY, open the application and enter your VPS IP address. Click <strong>Open<\/strong> and log in as the <strong>root<\/strong> user. Hostinger users can find their VPS login information by navigating to <strong>hPanel<\/strong> &rarr; <strong>VPS<\/strong> &rarr; <strong>Manage<\/strong> &rarr; <strong>SSH access<\/strong>.<\/p><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"69df7dc1cb7f2\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"447\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/ssh-access-credentials-in-hpanel-vps-overview-menu-1024x447.png\" alt=\"SSH access credentials in hPanel's VPS overview menu\" class=\"wp-image-110388\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/ssh-access-credentials-in-hpanel-vps-overview-menu-1024x447.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/ssh-access-credentials-in-hpanel-vps-overview-menu-300x131.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/ssh-access-credentials-in-hpanel-vps-overview-menu-150x66.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/ssh-access-credentials-in-hpanel-vps-overview-menu-768x336.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/ssh-access-credentials-in-hpanel-vps-overview-menu.png 1460w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>Since using root for running <a href=\"\/my\/tutorials\/linux-commands\">Linux commands<\/a> can be risky due to the lack of confirmation, let&rsquo;s create a new superuser. Here is the command:<\/p><pre class=\"wp-block-preformatted\">adduser your-username<\/pre><p>Enter your new user&rsquo;s password and other details. Then, grant the account administrative privileges by adding it to the<strong> sudo<\/strong> group:<\/p><pre class=\"wp-block-preformatted\">usermod -a -G sudo your-username<\/pre><p>Now, let&rsquo;s switch to the new users using the following command:<\/p><pre class=\"wp-block-preformatted\">su your-username<\/pre><p>Once your command-line name changes, enter <strong>cd<\/strong> to return to the home directory, and we can proceed with the installation.<\/p><h3 class=\"wp-block-heading\" id=\"h-2-update-your-system-package-repository\">2. Update Your System Package Repository<\/h3><p>Start by updating your system repository package list to ensure you get the latest software version. Here&rsquo;s how to do so on Ubuntu:<\/p><pre class=\"wp-block-preformatted\">sudo apt update<\/pre><p>Enter the user password and press <strong>Y<\/strong> if the command line asks for confirmation.<\/p><p>Although optional, we also recommend installing the latest available patch to avoid incompatibility issues. Here is the command:<\/p><pre class=\"wp-block-preformatted\">sudo apt upgrade<\/pre><h3 class=\"wp-block-heading\" id=\"h-3-install-the-python-pip-package\">3. Install the Python pip Package<\/h3><p>To work correctly, the pip package manager requires Python as the interpreter. Since the programming language is usually pre-configured in Ubuntu, run this command to check if your system has it:<\/p><pre class=\"wp-block-preformatted\">python3 -V<\/pre><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"69df7dc1cd728\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-full wp-lightbox-container\"><img decoding=\"async\" width=\"946\" height=\"48\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/command-line-interface-returns-installed-python-version.png\" alt=\"command-line interface returns installed Python version\" class=\"wp-image-110389\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/command-line-interface-returns-installed-python-version.png 946w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/command-line-interface-returns-installed-python-version-300x15.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/command-line-interface-returns-installed-python-version-150x8.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/command-line-interface-returns-installed-python-version-768x39.png 768w\" sizes=\"(max-width: 946px) 100vw, 946px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>If your command-line interface returns the Python version number, the programming language is already installed.<\/p><p>Otherwise, an error message will show up, and you must manually configure it by running:<\/p><pre class=\"wp-block-preformatted\">sudo apt install python3<\/pre><p>Press <strong>Y<\/strong> and <strong>Enter<\/strong> to confirm the setup. Then, run the following command to install pip and all dependencies for building Python modules:<\/p><pre class=\"wp-block-preformatted\">sudo apt install python3-pip<\/pre><p>Now, query the pip version to ensure it is installed correctly using the following command:<\/p><pre class=\"wp-block-preformatted\">pip3 --version<\/pre><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"69df7dc1cf3c4\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-full wp-lightbox-container\"><img decoding=\"async\" width=\"928\" height=\"46\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/command-line-interface-returns-installed-pip-version.png\" alt=\"command-line interface returns installed pip version\" class=\"wp-image-110390\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/command-line-interface-returns-installed-pip-version.png 928w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/command-line-interface-returns-installed-pip-version-300x15.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/command-line-interface-returns-installed-pip-version-150x7.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/command-line-interface-returns-installed-pip-version-768x38.png 768w\" sizes=\"(max-width: 928px) 100vw, 928px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>That&rsquo;s it! Now, you can use pip to manage your Python application&rsquo;s dependencies.<\/p><p>By default, you should get the latest version from your system&rsquo;s repository. To update it, run:<\/p><pre class=\"wp-block-preformatted\">sudo pip3 install --upgrade pip<\/pre><p><div><p class=\"important\"><strong>Important!<\/strong> The pip3 package manager will only work on the Python 3 environment. Use pip if you are running Python or Python2.<\/p><\/div>\n\n\n\n<\/p><h3 class=\"wp-block-heading\" id=\"h-4-use-pip-to-manage-python-packages\">4. Use pip to Manage Python Packages<\/h3><p>Before using pip to install packages, let&rsquo;s learn how it works.<\/p><p>Unlike Linux&rsquo;s default package managers that fetch software from the operating system&rsquo;s repository, this tool uses the more comprehensive <a href=\"https:\/\/pypi.org\/\" target=\"_blank\" rel=\"noopener\">Python Package Index<\/a> (PyPI).<\/p><p>When installing Python packages, pip automatically checks whether all the dependencies are already configured. Otherwise, it installs them first to ensure compatibility and functionality.<\/p><p>To install Python modules using pip, run the following command syntax:<\/p><pre class=\"wp-block-preformatted\">sudo pip install package-name<\/pre><p>Replace <strong>package-name <\/strong>with your desired software. For example, run the following to install the <strong>Scrapy<\/strong> web crawling network tool:<\/p><pre class=\"wp-block-preformatted\">sudo pip3 install scrapy<\/pre><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"69df7dc1d1097\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-full wp-lightbox-container\"><img decoding=\"async\" width=\"960\" height=\"267\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/pip-installs-scrapy-and-its-dependencies.png\" alt=\"pip installs Scrapy and its dependencies\" class=\"wp-image-110391\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/pip-installs-scrapy-and-its-dependencies.png 960w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/pip-installs-scrapy-and-its-dependencies-300x83.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/pip-installs-scrapy-and-its-dependencies-150x42.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/pip-installs-scrapy-and-its-dependencies-768x214.png 768w\" sizes=\"(max-width: 960px) 100vw, 960px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>If you want to configure a specific package version, add the number at the end of your command. For example, the following will set up <strong>Scrapy 1.5<\/strong>:<\/p><pre class=\"wp-block-preformatted\">sudo pip3 install scrapy==1.5<\/pre><p>You can check all installed pip packages and their version using the <strong>list<\/strong> command. To find a specific software, pipe the output to <strong>grep<\/strong> like so:<\/p><pre class=\"wp-block-preformatted\">sudo pip3 list | Scrapy<\/pre><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"69df7dc1d2c24\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-full wp-lightbox-container\"><img decoding=\"async\" width=\"820\" height=\"46\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/pip-list-and-grep-search-an-installed-package.png\" alt=\"pip list and Grep search an installed package\" class=\"wp-image-110392\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/pip-list-and-grep-search-an-installed-package.png 820w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/pip-list-and-grep-search-an-installed-package-300x17.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/pip-list-and-grep-search-an-installed-package-150x8.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/05\/pip-list-and-grep-search-an-installed-package-768x43.png 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p><div><p class=\"important\"><strong>Important!<\/strong> If your command-line interface gives an empty output, check for capitalization since Linux is case-sensitive.<\/p><\/div>\n\n\n\n<\/p><p>To update a Python package, use the &ndash;upgrade option like the following command:<\/p><pre class=\"wp-block-preformatted\">sudo pip3 install scrapy --upgrade<\/pre><p>To remove a package from your Ubuntu system, enter the following command but replace <strong>package-name <\/strong>with the actual software name:<\/p><pre class=\"wp-block-preformatted\">sudo pip3 uninstall package-name<\/pre><p>By default, the <strong>uninstall <\/strong>command doesn&rsquo;t remove the software&rsquo;s dependencies since other modules might still use them. Keeping unused Python packages might present security risks if not updated and managed correctly.<\/p><p>If you wish to remove the dependencies, list their names in a <strong>TXT<\/strong> file and specify it in your command like so:<\/p><pre class=\"wp-block-preformatted\">sudo pip3 uninstall package-name -r dependency_list.txt<\/pre><p>We recommend checking the <a href=\"https:\/\/pip.pypa.io\/en\/stable\/cli\/\" target=\"_blank\" rel=\"noopener\">pip documentation<\/a> to learn other utilities for managing Python packages. Alternatively, ask Kodee to generate commands based on your needs.<\/p><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"69df7dc1d4928\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"499\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/10\/scrapy-installation-command-generated-by-kodee-1024x499.png\" alt=\"Scrapy installation command generated by Kodee AI assistant\" class=\"wp-image-117110\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/10\/scrapy-installation-command-generated-by-kodee-1024x499.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/10\/scrapy-installation-command-generated-by-kodee-300x146.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/10\/scrapy-installation-command-generated-by-kodee-150x73.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/10\/scrapy-installation-command-generated-by-kodee-768x374.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/10\/scrapy-installation-command-generated-by-kodee-1536x748.png 1536w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/10\/scrapy-installation-command-generated-by-kodee-2048x997.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>pip lets you easily manage Python software packages to prepare your hosting environment before deployment. In this tutorial, we have explained how to install this tool on an Ubuntu server.<\/p><p>After purchasing a Linux VPS hosting plan from Hostinger and installing<strong> Ubuntu 22.04<\/strong>, follow these steps:<\/p><ol class=\"wp-block-list\">\n<li>Access your VPS using an SSH client or Terminal and create a new superuser account.<\/li>\n\n\n\n<li>To get the latest package version, update your system&rsquo;s repository using <strong>apt update<\/strong> and <strong>apt upgrade<\/strong>.<\/li>\n\n\n\n<li>Configure<strong> Python3 <\/strong>and<strong> Pip3<\/strong> using the<strong> apt install <\/strong>command.<\/li>\n\n\n\n<li>Download, list, update, and remove installed packages from the Python Package Index repository using the <strong>pip3<\/strong> command.<\/li>\n<\/ol><p>To simplify Python package management, use Kodee to help generate pip commands for your tasks.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-install-python-pip-on-ubuntu-faq\">How to Install Python pip on Ubuntu FAQ<\/h2><p>To deepen your understanding, this section will answer several questions about installing pip on an Ubuntu machine.<\/p><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1716296096027\"><h3 class=\"schema-faq-question\">What Is the Command to Check if pip Is Installed on Ubuntu?<\/h3> <p class=\"schema-faq-answer\">To check whether pip is installed, query its version using the <strong>pip3 &ndash;version<\/strong> command. If your command-line interface returns a number, the software is configured correctly. Otherwise, it will output the &ldquo;command not found&rdquo; error.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1716296100860\"><h3 class=\"schema-faq-question\">Are There Any Dependencies for Installing pip on Ubuntu?<\/h3> <p class=\"schema-faq-answer\">Yes. Before installing pip3 on Ubuntu, configure the Python 3 package using the <strong>apt install python3<\/strong> command. Remember to install the correct pip version since pip3 only works on Python 3 environments.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1716296108736\"><h3 class=\"schema-faq-question\">How Do I Update pip on Ubuntu?<\/h3> <p class=\"schema-faq-answer\">To update pip, run the <strong>pip3 install &ndash;upgrade<\/strong> command in your Terminal. It will fetch the newer version from PyPI instead of your system&rsquo;s default repository, meaning you don&rsquo;t need to run <strong>apt<\/strong> <strong>update<\/strong> beforehand.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>pip, stands for pip Installs Packages, is a package management system for installing Python dependencies. Unlike Linux&rsquo;s default software manager, this tool has additional features that make it more flexible and reliable. For example, pip uses a more comprehensive repository and has dependency resolution to ensure compatibility. This makes pip the preferred tool for managing [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/my\/tutorials\/install-pip-in-ubuntu\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":337,"featured_media":49134,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Install PIP on Ubuntu","rank_math_description":"Learn how to install pip Python package manager on Ubuntu: 1. Connect to your server 2. Update system repository 3. Install pip + more\ufeff","rank_math_focus_keyword":"install pip ubuntu","footnotes":""},"categories":[1],"tags":[],"class_list":["post-15653","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/install-pip-in-ubuntu","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/installer-pip-sur-ubuntu","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/instalar-python-pip-ubuntu","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-install-pip-python-ubuntu","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/install-pip-in-ubuntu","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/install-pip-ubuntu","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/install-pip-ubuntu","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/que-son-hooks-wordpress-14","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/que-son-hooks-wordpress-14","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-usar-tmux-4","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/install-pip-in-ubuntu","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/install-pip-in-ubuntu","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/install-pip-in-ubuntu","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/install-pip-in-ubuntu","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/15653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/users\/337"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/comments?post=15653"}],"version-history":[{"count":29,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/15653\/revisions"}],"predecessor-version":[{"id":117925,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/15653\/revisions\/117925"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/media\/49134"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/media?parent=15653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/categories?post=15653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/tags?post=15653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}