{"id":3152,"date":"2022-08-01T13:15:58","date_gmt":"2022-08-01T13:15:58","guid":{"rendered":"https:\/\/arzhost.com\/blogs\/?p=3152"},"modified":"2025-09-23T14:29:33","modified_gmt":"2025-09-23T09:29:33","slug":"pip-upgrade-a-package","status":"publish","type":"post","link":"https:\/\/arzhost.com\/blogs\/pip-upgrade-a-package\/","title":{"rendered":"PIP Upgrade a Package in Windows Latest Version"},"content":{"rendered":"<p>Today here at <a href=\"https:\/\/arzhost.com\/\">Arzhost<\/a>, we discuss how <span style=\"color: #0000ff;\"><strong>PIP Upgrade a Package<\/strong><\/span> in Windows. Python offers a wide range of modules and packages to aid you in carrying out different activities in your applications and websites. To take advantage of the most recent features and security patches. It is always recommended to maintain these packages updated. It could be time-consuming to update each package separately if your Python installation has several packages.<\/p>\n<p>This post will show you how to upgrade any <a href=\"https:\/\/stackoverflow.com\/questions\/15221473\/how-do-i-update-upgrade-pip-itself-from-inside-my-virtual-environment\" target=\"_blank\" rel=\"noopener\">PIP Upgrade<\/a> a Package with a single line of code using pip. You can see all the steps necessary to completely upgrade PIP in Windows in this quick tutorial.<\/p>\n<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/VhOhojy0b28\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><u>The following subjects will be reviewed:<\/u><\/p>\n<ul>\n<li>PIP update for Windows<\/li>\n<li>Verify the PIP version.<\/li>\n<li>Revert PIP to an earlier version<\/li>\n<\/ul>\n<p>You must first open the Windows Command Prompt before entering or copying the command below to PIP Upgrade a Package in Windows. Note that the following method would only work if you already added Python to the Windows path. Don\u2019t worry if you don\u2019t know what it means, as you\u2019ll see the full steps to upgrade pip in the next section.<\/p>\n<ul>\n<li><code>python -m pip install --upgrade pip<\/code><\/li>\n<\/ul>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/arzhost.com\/blogs\/pip-upgrade-a-package\/#How_to_Use_Pip_to_Update_All_Python_Packages\" >How to Use Pip to Update All Python Packages?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/arzhost.com\/blogs\/pip-upgrade-a-package\/#1_Obtain_a_list_of_out-of-date_packages\" >1: Obtain a list of out-of-date packages<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/arzhost.com\/blogs\/pip-upgrade-a-package\/#2_Discontinue_editing_package_definitions\" >2: Discontinue editing package definitions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/arzhost.com\/blogs\/pip-upgrade-a-package\/#3_Remove_package_names\" >3: Remove package names<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/arzhost.com\/blogs\/pip-upgrade-a-package\/#4_Refresh_Packages\" >4: Refresh Packages<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/arzhost.com\/blogs\/pip-upgrade-a-package\/#How_to_check_Windows_for_PIP_version\" >How to check Windows for PIP version?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/arzhost.com\/blogs\/pip-upgrade-a-package\/#How_to_revert_PIP_to_a_previous_version\" >How to revert PIP to a previous version?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/arzhost.com\/blogs\/pip-upgrade-a-package\/#Final_Words\" >Final Words<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Use_Pip_to_Update_All_Python_Packages\"><\/span><strong>How to Use Pip to Update All Python Packages?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Here are the instructions for using pip to update all python packages. Pip does not directly allow for this. Therefore, we will need to use the xargs and grep tools to accomplish this.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_Obtain_a_list_of_out-of-date_packages\"><\/span><strong><u>1: Obtain a list of out-of-date packages<\/u><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The pip command will be used to obtain a list of out-of-date packages.<\/p>\n<ul>\n<li><code>\u2014outdated \u2014format=freeze $ pip list<\/code><\/li>\n<\/ul>\n<p>Use the following command in its place if you have an older version of PIP Upgrade a Package.<\/p>\n<ul>\n<li><code>Pip freeze \u2014local for $<\/code><\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"2_Discontinue_editing_package_definitions\"><\/span><strong><u>2: Discontinue editing package definitions<\/u><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a href=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/python-tips-for-pip.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone  wp-image-13641\" title=\"python tips for pip\" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/python-tips-for-pip-300x157.jpg\" alt=\"python tips for pip\" width=\"730\" height=\"382\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/python-tips-for-pip-300x157.jpg 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/python-tips-for-pip-1024x536.jpg 1024w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/python-tips-for-pip-768x402.jpg 768w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/python-tips-for-pip.jpg 1200w\" sizes=\"(max-width: 730px) 100vw, 730px\" \/><\/a><\/p>\n<p>To avoid packages with editable definitions. We feed the output of the said command to the grep command.<\/p>\n<ul>\n<li><code>grep -v \"-e\" | pip list \u2014outdated | format=freeze<\/code><\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"3_Remove_package_names\"><\/span><strong><u>3: Remove package names<\/u><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The above output is then piped to the cut command to extract package names.<\/p>\n<ul>\n<li><code>grep -v \"-e\" | cut -d = -f 1 | pip list \u2014outdated \u2014format=freeze<\/code><\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"4_Refresh_Packages\"><\/span><strong><u>4: Refresh Packages<\/u><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Finally, we will create unique &#8220;<a href=\"https:\/\/packaging.python.org\/installing\/\" target=\"_blank\" rel=\"noopener\">pip install<\/a>&#8221; commands for each package using the xargs programmer. Even if one of the pip install commands fails, we will utilize the -n1 parameter to keep going. The xargs programme will go through the input&#8217;s list of out-of-date packages, creating and executing unique &#8221; PIP Upgrade a Package &#8221; commands for each one.<\/p>\n<ul>\n<li><code>xargs -n1 pip install -U $ pip list \u2014outdated \u2014format=freeze | grep -v \"-e\" | cut -d = -f 1 |<\/code><\/li>\n<\/ul>\n<p>You can adjust the aforementioned command as stated below if you&#8217;re using an older version of pip.<\/p>\n<ul>\n<li><code>xargs -n1 pip install -U $ pip freeze \u2014local | grep -v \"-e\" | cut -d = -f 1<\/code><\/li>\n<\/ul>\n<p>At here Arzhost, in this tutorial, we learned how to use pip to update every Python package.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_check_Windows_for_PIP_version\"><\/span><strong>How to check Windows for PIP version?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You must use the Python Scripts path rather than the Python application path to check the version of PIP at any time.<\/p>\n<p><u>1: Make sure your starting point only contains the drive name by typing &#8220;cd&#8221; first:<\/u><\/p>\n<ul>\n<li><code>C:\\Users\\Ron&gt;cd\\<\/code><\/li>\n<\/ul>\n<p><u>2: Next, find the path of your Python scripts. The Python application path should contain the Scripts folder.<\/u><\/p>\n<ul>\n<li><code>The Python Scripts path in our case is:<\/code><\/li>\n<li><code>C:\\Users\\Ron\\AppData\\Local\\Programs\\Python\\Python39\\Scripts<\/code><\/li>\n<\/ul>\n<p><u>3: Press Enter after typing &#8220;cd&#8221; and the path to the Python scripts:<\/u><\/p>\n<ul>\n<li><code>C:\\&gt;cd C:\\Users\\Ron\\AppData\\Local\\Programs\\Python\\Python39\\Scripts \\s (4)<\/code><\/li>\n<\/ul>\n<p><u>4: Finally, enter the command to verify PIP&#8217;s version as follows:<\/u><\/p>\n<ul>\n<li><code>pip \u2014version<\/code><\/li>\n<\/ul>\n<p>As an illustration:<\/p>\n<ul>\n<li><code>C:\\Users\\Ron\\AppData\\Local\\Programs\\Python\\Python39\\Scripts&gt;\u2014version pip<\/code><\/li>\n<\/ul>\n<p><u>5: Hit Enter to display the PIP version:<\/u><\/p>\n<ul>\n<li><code>pip 21.1.1<\/code><\/li>\n<\/ul>\n<p>What would happen if you wanted to go back to an earlier version of PIP? By following the instructions below, you can downgrade to a prior version of PIP with ease.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_revert_PIP_to_a_previous_version\"><\/span><strong>How to revert PIP to a previous version?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><u>1: Access the Python programme path first. You can quickly go back to the Python application path. If you are now set to the Python Scripts directory by typing &#8220;cd.&#8221; and pressing Enter:<\/u><\/p>\n<ul>\n<li><code>C:\\Users\\Ron\\AppData\\Local\\Programs\\Python\\Python39&gt;<\/code><\/li>\n<\/ul>\n<p><u>2: Assume you wish to downgrade PIP to version 18.1<\/u><\/p>\n<p>Simply enter the command that follows, then press Enter, to accomplish that:<\/p>\n<ul>\n<li><code>pip install pip==18.1 in Python<\/code><\/li>\n<\/ul>\n<p><u>3: The PIP version you requested should now be visible:<\/u><\/p>\n<ul>\n<li><code>pip-18.1 was installed successfully.<\/code><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Final_Words\"><\/span><strong>Final Words<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Today here at Arzhost, we learn how to PIP Upgrade a Package in window successfully. You might want to look at this tutorial that describes how to upgrade PIP in Anaconda if you use Anaconda. Finally, you might want to check the pip manual if you need to install PIP. Visit <a href=\"http:\/\/www.arzhost.com\">www.arzhost.com<\/a> for more learning.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today here at Arzhost, we discuss how PIP Upgrade a Package in Windows. Python offers a wide range of modules and packages to aid you in carrying out different activities in your applications and websites. To take advantage of the most recent features and security patches. It is always recommended to maintain these packages updated. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6554,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,29,19],"tags":[],"table_tags":[],"class_list":["post-3152","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial","category-python","category-window"],"_links":{"self":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/3152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/comments?post=3152"}],"version-history":[{"count":5,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/3152\/revisions"}],"predecessor-version":[{"id":13642,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/3152\/revisions\/13642"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media\/6554"}],"wp:attachment":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media?parent=3152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/categories?post=3152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/tags?post=3152"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/table_tags?post=3152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}