{"id":33366,"date":"2020-03-16T18:07:37","date_gmt":"2020-03-16T12:37:37","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=33366"},"modified":"2020-03-16T18:07:37","modified_gmt":"2020-03-16T12:37:37","slug":"how-to-install-python-pip-on-windows-mac-and-linux","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/how-to-install-python-pip-on-windows-mac-and-linux\/","title":{"rendered":"How to Install Python PIP on Windows, Mac, and Linux"},"content":{"rendered":"<p>Just like any serious programming language , Python supports third-party libraries and frameworks that you simply can install to avoid reinventing the wheel with every new project. If you would like to use them you&#8217;ll find these Python libraries on a central repository called the Python Package Index (PyPI).<\/p>\n<p>Downloading, installing, and managing these packages by hand are often frustrating and time-consuming. this is often why many Python developers believe a special tool called PIP for Python (or Python PIP) to form everything much easier and faster.<\/p>\n<h3 id=\"what-is-pip-for-python\">What Is PIP for Python?<\/h3>\n<p>PIP is an acronym that stands for <strong>\u201cPIP Installs Packages\u201d or \u201cPreferred Installer Program\u201d<\/strong>. It\u2019s a command-line utility that permits you to put in , reinstall, or uninstall PyPI packages with an easy and easy command: pip.<\/p>\n<p>If you\u2019ve ever done any command-line work on Windows (with the Command Prompt) or Mac or Linux (with the Terminal and Bash), then you&#8217;ll skip right down to the installation instructions for your particular OS .<\/p>\n<h3 id=\"is-pip-installed-with-python\">\u00a0Is PIP Installed With Python?<\/h3>\n<p>If you\u2019re using Python 2.7.9 (or greater) or Python 3.4 (or greater), then PIP comes installed with Python by default. If you\u2019re using an older version of Python, you\u2019ll got to use the installation steps below. Otherwise, skip to rock bottom to find out the way to start using PIP.<\/p>\n<p>If you\u2019re running Python during a virtual environment created with either virtualenv or pyvenv, then PIP are going to be available no matter the Python version.<\/p>\n<h3 id=\"is-python-correctly-installed\">Is Python Correctly Installed?<\/h3>\n<p>You have to form sure Python is correctly installed on your system. On Windows, open up the prompt using <strong>Windows key + X<\/strong> and selecting prompt . On Mac, open the Terminal using Command + Space and checking out terminal. On Linux, open the Terminal using <strong>Ctrl + Alt + T<\/strong>. Linux shortcuts may vary by distribution.<\/p>\n<p><strong>Then type:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">python --version<\/code><\/pre> <\/div>\n<p><strong>On Linux, Python 3.x users may need to use:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">python3 --version<\/code><\/pre> <\/div>\n<p>If you get a version number (e.g. \u201cPython 2.7.5\u201d) then Python is prepared to travel .<\/p>\n<p>If you get a \u201cPython isn&#8217;t defined\u201d message, then you\u2019ll need to first install Python properly. That\u2019s beyond the scope of this text . The Python site has some detailed instructions for installation.<\/p>\n<h3 id=\"how-to-install-pip-on-windows\">How to Install PIP on Windows<\/h3>\n<p>These instructions should work on Windows 7, Windows 8.1, and Windows 10:<\/p>\n<p>Download the get-pip.py installer script. If you\u2019re on Python 3.2, you\u2019ll need this version of get-pip.py instead. Either way, right-click on the link and choose Save As\u2026 and reserve it to any safe location, like your Downloads folder.<\/p>\n<p>Open the prompt and navigate to the get-pip.py file.<\/p>\n<p>Run the subsequent command: python get-pip.py<\/p>\n<h3 id=\"how-to-install-pip-on-mac\">How to Install PIP on Mac<\/h3>\n<p>Modern Mac systems accompany Python and PIP already installed. However, this version of Python tends to be outdated and not the simplest choice for serious Python development. It\u2019s highly recommended that you simply install a more current version of Python and PIP.<\/p>\n<p>If you would like to use the native system Python installation but don\u2019t have PIP available, you&#8217;ll install PIP with the subsequent command in Terminal:<\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo easy_install pip<\/code><\/pre> <\/div>\n<h3 id=\"how-to-install-pip-on-linux\">How to Install PIP on Linux<\/h3>\n<p>If your Linux distribution came with Python already installed, you should be able to install PIP using your system\u2019s package manager. This is preferable since system-installed versions of Python do not play nicely with the get-pip.py script used on Windows and Mac.<\/p>\n<p><strong>Advanced Package Tool (Python 2.x)<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo apt-get install python-pip<\/code><\/pre> <\/div>\n<p><strong>Advanced Package Tool (Python 3.x)<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo apt-get install python3-pip<\/code><\/pre> <\/div>\n<p><strong>pacman Package Manager (Python 2.x)<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo pacman -S python2-pip<\/code><\/pre> <\/div>\n<p><strong>pacman Package Manager (Python 3.x)<\/strong><\/p>\n<div id=\"snhb-in_content-5-0\" class=\"aligncenter mobile-only\">\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo pacman -S python-pip<\/code><\/pre> <\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<p><strong>Yum Package Manager (Python 2.x)<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo yum upgrade python-setuptools sudo yum install python-pip python-wheel<\/code><\/pre> <\/div>\n<p><strong>Yum Package Manager (Python 3.x)<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo yum install python3 python3-wheel<\/code><\/pre> <\/div>\n<p><strong>Dandified Yum (Python 2.x)<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo dnf upgrade python-setuptools sudo dnf install python-pip python-wheel<\/code><\/pre> <\/div>\n<p><strong>Dandified Yum (Python 3.x)<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo dnf install python3 python3-wheel<\/code><\/pre> <\/div>\n<p><strong>Zypper Package Manager (Python 2.x)<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo zypper install python-pip python-setuptools python-wheel<\/code><\/pre> <\/div>\n<p><strong>Zypper Package Manager (Python 3.x)<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo zypper install python3-pip python3-setuptools python3-wheel<\/code><\/pre> <\/div>\n<h3 id=\"how-to-install-pip-on-raspberry-pi\">How to Install PIP on Raspberry Pi<\/h3>\n<p>As a Raspberry Pi user, you\u2019re probably running Raspbian since it\u2019s the official OS designated and provided by the Raspberry Pi Foundation. You\u2019re liberal to install another OS , like Ubuntu. If that&#8217;s the case you ought to check out the Linux instructions.<\/p>\n<p>Starting with Raspbian Jessie, PIP comes installed by default. It\u2019s one among the large reasons to upgrade to Raspbian Jessie rather than sticking with Raspbian Wheezy or Raspbian Jessie Lite. However, if you\u2019re on an older version of Raspbian, you&#8217;ll still install PIP.<\/p>\n<p><strong>On Python 2.x:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo apt-get install python-pip<\/code><\/pre> <\/div>\n<p><strong>On Python 3.x:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo apt-get install python3-pip<\/code><\/pre> <\/div>\n<p>With Raspbian, Python 2.x users should use\u00a0<strong>pip<\/strong>\u00a0while Python 3.x users should use\u00a0<strong>pip3<\/strong>\u00a0when issuing PIP commands.<\/p>\n<h3 id=\"how-to-upgrade-pip-for-python\">How to Upgrade PIP for Python<\/h3>\n<p>While PIP itself doesn\u2019t update fairly often , it\u2019s still important to remain on top of latest versions because there could also be important fixes to bugs, compatibility, and security holes. Fortunately, upgrading PIP is quick and straightforward .<\/p>\n<p><strong>On Windows:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">python -m pip install -U pip<\/code><\/pre> <\/div>\n<p><strong>On Mac, Linux, or Raspberry Pi:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">pip install -U pip<\/code><\/pre> <\/div>\n<h2 id=\"how-to-manage-python-packages-with-pip\">How to Manage Python Packages With PIP<\/h2>\n<p><strong>Once PIP is ready, you can start installing packages from PyPI:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">pip install package-name<\/code><\/pre> <\/div>\n<p><strong>To install a specific version of a package instead of the latest version:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">pip install package-name==1.0.0<\/code><\/pre> <\/div>\n<p><strong>To search PyPI for a particular package:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">pip search &quot;query&quot;<\/code><\/pre> <\/div>\n<p><strong>To see details about an installed package:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">pip show package-name<\/code><\/pre> <\/div>\n<p><strong>To list all installed packages:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">pip list<\/code><\/pre> <\/div>\n<p><strong>To list all outdated packages:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">pip list --outdated<\/code><\/pre> <\/div>\n<p><strong>To upgrade an outdated package:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">pip install package-name --upgrade<\/code><\/pre> <\/div>\n<p>Note that older versions of a package are automatically removed by PIP when upgrading to a newer version of that package.<\/p>\n<p><strong>To completely reinstall a package:<\/strong><\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\"><\/code><\/pre>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">pip install package-name --upgrade --force-reinstall<\/code><\/pre> <\/div>\n<pre class=\" language-bash\"><code class=\" language-bash\"><\/code><\/pre>\n<p><strong>To completely get rid of a package:<\/strong><\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">pip uninstall package-name<\/code><\/pre> <\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just like any serious programming language , Python supports third-party libraries and frameworks that you simply can install to avoid reinventing the wheel with every new project. If you would like to use them you&#8217;ll find these Python libraries on a central repository called the Python Package Index (PyPI). Downloading, installing, and managing these packages [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":33388,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4148],"tags":[86866,86869,86868,86867,86865],"class_list":["post-33366","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-pip","tag-pip-for-python","tag-pip-install","tag-pip-on-mac","tag-pyhton"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/33366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/comments?post=33366"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/33366\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media\/33388"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=33366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=33366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=33366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}