{"id":24053,"date":"2020-10-12T15:44:30","date_gmt":"2020-10-12T22:44:30","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=24053"},"modified":"2023-12-01T04:01:28","modified_gmt":"2023-12-01T12:01:28","slug":"python-pip-command-not-found","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/","title":{"rendered":"Python pip: command not found Solution"},"content":{"rendered":"\n<p>pip allows you to download packages you can reference in your <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-python\/\">Python code<\/a>. If you try to install a package using pip without having the package manager installed on your computer, you\u2019ll encounter the <code>pip: command not found<\/code> error.<br><\/p>\n\n\n\n<p>In this guide, we discuss the cause of this error. We then walk through two potential solutions to this error so you can fix the problem you are encountering.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">pip: command not found<\/h2>\n\n\n\n<p>On Linux, the pip package manager is an independent package. This means you must install pip separately from Python. On Mac, you do not need to worry about installing pip manually, as long as you are working with Python 3.x.<br><\/p>\n\n\n\n<p>A <code>command not found<\/code> error is raised on Linux if there is no command on the system by the name you have referenced. You must have pip installed on your system before you can install packages.<br><\/p>\n\n\n\n<p><a href=\"https:\/\/careerkarma.com\/blog\/python-2-vs-python-3\/\">Python 2<\/a> has reached its end of life. This means Python 2 is no longer being actively maintained or changed. You should try to move your code over to a codebase that supports Python 3. When you are working with Python 3, use pip3 instead of pip.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cause #1: Using the Wrong Environment<\/h2>\n\n\n\n<p>Python 2.7 and other versions of Python 2 rely on the bash pip command whereas the Python 3 command relies on pip3. We have written a program called hello.py which uses a <a href=\"https:\/\/careerkarma.com\/blog\/python-print-without-new-line\/\">print() statement<\/a> to display \u201cHello world!\u201d to the command line console:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>print(&quot;Hello world!&quot;)<\/pre><\/div>\n\n\n\n<p>This program was written in Python 3. To execute this program, we will use the python3 command:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>python3 hello.py<\/pre><\/div>\n\n\n\n<p>Our code prints out the message \u201cHello world!\u201d to the console.<br><\/p>\n\n\n\n<p>Let\u2019s say that we want to install the <a href=\"https:\/\/careerkarma.com\/blog\/python-requests\/\">\u201crequests\u201d library<\/a> so we can make a web request in our script. Because we are using Python 3, we should use pip3. If we try to use pip, we\u2019ll encounter an error:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>pip: command not found<\/pre><\/div>\n\n\n\n<p>We do not have pip installed because we are working in a Python 3 development environment. If we replace <code>pip<\/code> with <code>pip3<\/code>, our command will work:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>pip3 install requests<\/pre><\/div>\n\n\n\n<p>Our command shows us the installation process:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Requirement already satisfied: requests in .\/Library\/Python\/3.8\/lib\/python\/site-packages (2.24.0)\n\u2026 <\/pre><\/div>\n\n\n\n<p>We already had the requests library installed. If we did not have the requests library installed, we would see pip3 install the library.<br><\/p>\n\n\n\n<p>The pip3 command uses the pip3 Python package manager to install the \u201crequests\u201d library. We have configured pip3 which means this command works.<br><\/p>\n\n\n\n<p>If you do not already have pip3 installed, you can install it using apt-get:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>sudo apt-get -y install python3-pip<\/pre><\/div>\n\n\n\n<p>After you have run this command, you\u2019ll be able to use the pip3 package manager on your system.<br><\/p>\n\n\n\n<p>pip3 is bundled with Python 3 on MacOS so you do not need to run any additional commands. If you do not have pip3 installed already, you should try to reinstall Python 3. This will install pip3 automatically. You can install Python 3 using the brew command:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>brew install python3<\/pre><\/div>\n\n\n\n<p>We now have both Python 3 and pip3 installed on our system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cause #2: Not Downloading Python 2 pip<\/h2>\n\n\n\n<p>The <code>pip: command not found<\/code> error may occur if you have not installed Python 2 pip on your system. The below steps should be followed only if your code is written in Python 2. Otherwise, you should move your codebase over to Python 3 because Python 2 has reached its end of life.<br><\/p>\n\n\n\n<p>To install pip in Python 2, you must use the <code>easy_install<\/code> command:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>sudo easy_install pip<\/pre><\/div>\n\n\n\n<p>This command installs the pip command onto your system. If you do not already have <code>easy_install<\/code> installed, install it using the following <a href=\"https:\/\/careerkarma.com\/blog\/linux-command-line\/\">Linux command<\/a>:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>sudo apt-get install python-setuptools<\/pre><\/div>\n\n\n\n<p>The <code>easy_install<\/code> tool is deprecated. This is because Python is moving its focus to Python 3 where pip3 is the main package manager that you should use for installing a package.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The <code>pip: command not found<\/code> error is raised if you do not have pip installed on your system, or if you\u2019ve accidentally used the pip command instead of pip3.<br><\/p>\n\n\n\n<p>To solve this error, make sure you have installed both Python 3 and pip3 onto your system. If you are working with a legacy codebase, use <code>easy_install<\/code> to install pip.<br><\/p>\n\n\n\n<p>Now you have the skills you need to solve this error like a pro!<\/p>\n","protected":false},"excerpt":{"rendered":"pip allows you to download packages you can reference in your Python code. If you try to install a package using pip without having the package manager installed on your computer, you\u2019ll encounter the pip: command not found error. In this guide, we discuss the cause of this error. We then walk through two potential&hellip;","protected":false},"author":240,"featured_media":17856,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-24053","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"Python","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Python pip: command not found Solution | Career Karma<\/title>\n<meta name=\"description\" content=\"On Career Karma, learn about the Python pip: command not found error, why the error is raised, and how to solve the error.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python pip: command not found Solution\" \/>\n<meta property=\"og:description\" content=\"On Career Karma, learn about the Python pip: command not found error, why the error is raised, and how to solve the error.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-12T22:44:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:01:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/lauren-mancke-aOC7TSLb1o8-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"678\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python pip: command not found Solution\",\"datePublished\":\"2020-10-12T22:44:30+00:00\",\"dateModified\":\"2023-12-01T12:01:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/\"},\"wordCount\":650,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/lauren-mancke-aOC7TSLb1o8-unsplash.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/\",\"name\":\"Python pip: command not found Solution | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/lauren-mancke-aOC7TSLb1o8-unsplash.jpg\",\"datePublished\":\"2020-10-12T22:44:30+00:00\",\"dateModified\":\"2023-12-01T12:01:28+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"On Career Karma, learn about the Python pip: command not found error, why the error is raised, and how to solve the error.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/lauren-mancke-aOC7TSLb1o8-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/lauren-mancke-aOC7TSLb1o8-unsplash.jpg\",\"width\":1020,\"height\":678},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https:\/\/careerkarma.com\/blog\/python\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python pip: command not found Solution\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python pip: command not found Solution | Career Karma","description":"On Career Karma, learn about the Python pip: command not found error, why the error is raised, and how to solve the error.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/","og_locale":"en_US","og_type":"article","og_title":"Python pip: command not found Solution","og_description":"On Career Karma, learn about the Python pip: command not found error, why the error is raised, and how to solve the error.","og_url":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-10-12T22:44:30+00:00","article_modified_time":"2023-12-01T12:01:28+00:00","og_image":[{"width":1020,"height":678,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/lauren-mancke-aOC7TSLb1o8-unsplash.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python pip: command not found Solution","datePublished":"2020-10-12T22:44:30+00:00","dateModified":"2023-12-01T12:01:28+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/"},"wordCount":650,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/lauren-mancke-aOC7TSLb1o8-unsplash.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/","url":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/","name":"Python pip: command not found Solution | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/lauren-mancke-aOC7TSLb1o8-unsplash.jpg","datePublished":"2020-10-12T22:44:30+00:00","dateModified":"2023-12-01T12:01:28+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"On Career Karma, learn about the Python pip: command not found error, why the error is raised, and how to solve the error.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/lauren-mancke-aOC7TSLb1o8-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/lauren-mancke-aOC7TSLb1o8-unsplash.jpg","width":1020,"height":678},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-pip-command-not-found\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Python","item":"https:\/\/careerkarma.com\/blog\/python\/"},{"@type":"ListItem","position":3,"name":"Python pip: command not found Solution"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/24053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=24053"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/24053\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/17856"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=24053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=24053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=24053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}