{"id":2671,"date":"2018-11-06T13:26:53","date_gmt":"2018-11-06T13:26:53","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=2671"},"modified":"2018-11-07T14:14:18","modified_gmt":"2018-11-07T14:14:18","slug":"find-guide-on-installing-pip-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/11\/06\/find-guide-on-installing-pip-on-ubuntu\/","title":{"rendered":"Find Guide on Installing Pip on Ubuntu"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linoxide.com\/wp-content\/uploads\/2018\/11\/install-pip-ubuntu.png\" alt=\"install pip ubuntu\" width=\"713\" height=\"341\" \/><\/p>\n<p>Pip is a package manager that facilitates the installation and management of Python software packages, for instance, those contained in the Python Package Index (PyPI).<\/p>\n<p>In this article, I am going to show you how to install and use pip on Ubuntu 18.04.<\/p>\n<h2>Install pip for Python3 on Ubuntu<\/h2>\n<p>By default, <a href=\"https:\/\/linoxide.com\/distros\/install-ubuntu-18-04-dual-boot-windows-10\/\" target=\"_blank\" rel=\"noopener\">Ubuntu 18.04<\/a> comes with Python3 in its installation. To install pip3 for Python3 follow the following steps<\/p>\n<h3>Update the system<\/h3>\n<p># sudo apt-get update<\/p>\n<h3>Install pip for python3<\/h3>\n<p># sudo apt-get install python3-pip<\/p>\n<p>This command installs pip together with all the dependencies necessary for building python modules.<\/p>\n<p>Sample Output<\/p>\n<p>The following NEW packages will be installed:<br \/>\nlibpython3-dev libpython3.4 libpython3.4-dev python3-chardet<br \/>\npython3-colorama python3-dev python3-distlib python3-html5lib python3-pip<br \/>\npython3-requests python3-setuptools python3-six python3-urllib3<br \/>\npython3-wheel python3.4-dev<br \/>\n0 upgraded, 15 newly installed, 0 to remove and 26 not upgraded.<br \/>\nNeed to get 20.2 MB of archives.<br \/>\nAfter this operation, 38.7 MB of additional disk space will be used.<br \/>\nDo you want to continue? [Y\/n] Y<\/p>\n<h2>Checking the version of pip3<\/h2>\n<p>To check the version of pip3 run the command below<\/p>\n<p># pip3 &#8211;version<\/p>\n<p>OR<\/p>\n<p># pip3 -V<\/p>\n<p>Output<\/p>\n<p>pip 8.1.1 from \/usr\/lib\/python3\/dist-packages (python 3.5)<\/p>\n<h2>Install pip for Python2 on Ubuntu<\/h2>\n<p>Python2 is not installed by default on Ubuntu 18.04. If you wish to install Python2 and pip for Python 2 run the following commands<\/p>\n<h3>Update the system<\/h3>\n<p># sudo apt-get update<\/p>\n<h3>Install pip for python2<\/h3>\n<p># sudo apt-get install python-pip<\/p>\n<h2>Checking the version of pip<\/h2>\n<p>To verify the installation of pip, run<\/p>\n<p># pip &#8211;version<\/p>\n<p>OR<\/p>\n<p># pip -V<\/p>\n<p>Output<\/p>\n<p># pip 10.0.1 from \/usr\/local\/lib\/python2.7\/dist-packages\/pip (python 2.7)<\/p>\n<h2>Using pip in package management<\/h2>\n<p>Now that we have seen how to install various versions of pip in different python environments, it&#8217;s time to see how we can use it to install, upgrade and uninstall packages.<\/p>\n<h3>Installing a package with pip<\/h3>\n<p>When installing python modules, it&#8217;s recommended that you do so in virtual environments. a virtual environment creates an isolated environment for several python projects. This allows you to install a specific module per project without worrying about the module affecting other Python projects.<\/p>\n<h3>To install a package with pip<\/h3>\n<p># pip3 install package_name<\/p>\n<p>For instance<\/p>\n<p># pip install numpy<\/p>\n<p>Output<\/p>\n<p>Collecting numpy<br \/>\nDownloading https:\/\/files.pythonhosted.org\/packages\/40\/c5\/f1ed15dd931d6667b40f 1ab1c2fe1f26805fc2b6c3e25e45664f838de9d0\/numpy-1.15.2-cp27-cp27mu-manylinux1_x86 _64.whl (13.8MB)<br \/>\n100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 13.8MB 3.2MB\/s<br \/>\nInstalling collected packages: numpy<br \/>\nSuccessfully installed numpy-1.15.2<br \/>\nYou are using pip version 10.0.1, however version 18.1 is available.<br \/>\nYou should consider upgrading via the &#8216;pip install &#8211;upgrade pip&#8217; command.<\/p>\n<h3>To install a specific version of a package<\/h3>\n<p>If you wish to specify installation of a specific package run,<\/p>\n<p># pip3 install package_name==version no.<\/p>\n<p>For example<\/p>\n<p># pip3 install numpy=1.15<\/p>\n<p>Output<\/p>\n<p>Collecting numpy==1.15<br \/>\nDownloading https:\/\/files.pythonhosted.org\/packages\/29\/b9\/479ccb55cc7dcff3d4fc7c8c26d4887846875e7d4f04483a36f335bed712\/numpy-1.15.0-cp35-cp35m-manylinux1_x86_64.whl (13.8MB)<br \/>\n100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 13.8MB 101kB\/s<br \/>\nInstalling collected packages: numpy<br \/>\nSuccessfully installed numpy-1.15.0<br \/>\nYou are using pip version 10.0.1, however version 18.1 is available.<br \/>\nYou should consider upgrading via the &#8216;pip install &#8211;upgrade pip&#8217; command.<\/p>\n<h3>To upgrade a package with pip<\/h3>\n<p>To upgrade a package to its latest version using pip run<\/p>\n<p># pip3 install &#8211;upgrade package_name<\/p>\n<p>For example, we have seen from the output above that we are running pip version 10.0.1. To upgrade to the latest version which is 18.1, run<\/p>\n<p># pip3 install &#8211;upgrade pip<\/p>\n<p>Output<\/p>\n<p>Collecting pip<br \/>\nDownloading https:\/\/files.pythonhosted.org\/packages\/c2\/d7\/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37\/pip-18.1-py2.py3-none-any.whl (1.3MB)<br \/>\n100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 1.3MB 7.5MB\/s<br \/>\nInstalling collected packages: pip<br \/>\nFound existing installation: pip 10.0.1<br \/>\nUninstalling pip-10.0.1:<br \/>\nSuccessfully uninstalled pip-10.0.1<br \/>\nSuccessfully installed pip-18.1<\/p>\n<h2>To uninstall a package with pip<\/h2>\n<p>To uninstall a package with pip run<\/p>\n<p># pip3 uninstall package_name<\/p>\n<p>For example<\/p>\n<p># pip3 uninstall numpy<\/p>\n<p>Output<\/p>\n<p>Uninstalling numpy-1.15.2:<br \/>\nWould remove:<br \/>\n\/usr\/local\/bin\/f2py<br \/>\n\/usr\/local\/lib\/python2.7\/dist-packages\/numpy-1.15.2.dist-info\/*<br \/>\n\/usr\/local\/lib\/python2.7\/dist-packages\/numpy\/*<br \/>\nProceed (y\/n)? y<\/p>\n<h3>Viewing more options with pip<\/h3>\n<p>To view more pip options on the usage of pip run<\/p>\n<p># pip3 &#8211;help<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linoxide.com\/wp-content\/uploads\/2018\/10\/pip-help-1024x368.png\" alt=\"install and use pip on Ubuntu\" width=\"1024\" height=\"368\" \/><\/p>\n<p>In this guide, we have seen how to install and use pip on Ubuntu to install, upgrade and uninstall packages. For more options on pip usage, visit this <a href=\"https:\/\/pip.pypa.io\/en\/stable\/user_guide\/\" target=\"_blank\" rel=\"noopener\">documentation.<\/a><\/p>\n<h3>Read Also:<\/h3>\n<ul>\n<li><a href=\"https:\/\/linoxide.com\/linux-how-to\/install-python-ubuntu\/\" target=\"_blank\" rel=\"noopener\">How to Install Latest Python on Ubuntu 18.04<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/linoxide.com\/linux-how-to\/learn-how-install-pip-ubuntu\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pip is a package manager that facilitates the installation and management of Python software packages, for instance, those contained in the Python Package Index (PyPI). In this article, I am going to show you how to install and use pip on Ubuntu 18.04. Install pip for Python3 on Ubuntu By default, Ubuntu 18.04 comes with &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/11\/06\/find-guide-on-installing-pip-on-ubuntu\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Find Guide on Installing Pip on Ubuntu&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2671","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/2671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=2671"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/2671\/revisions"}],"predecessor-version":[{"id":2816,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/2671\/revisions\/2816"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=2671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=2671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=2671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}