{"id":113104,"date":"2026-06-07T19:13:14","date_gmt":"2026-06-07T13:43:14","guid":{"rendered":"https:\/\/www.guvi.in\/blog\/?p=113104"},"modified":"2026-06-07T19:13:17","modified_gmt":"2026-06-07T13:43:17","slug":"how-to-add-python-to-path-in-windows","status":"publish","type":"post","link":"https:\/\/www.guvi.in\/blog\/how-to-add-python-to-path-in-windows\/","title":{"rendered":"How to Add Python to PATH in Windows, macOS, and Linux"},"content":{"rendered":"\n<p>After installing Python, many users expect commands like python and pip to work right away. However, that&#8217;s not always true. You might see errors such as &#8220;Python is not recognized as an internal or external command&#8221; or &#8220;command not found: python,&#8221; even though Python is already on your system.<\/p>\n\n\n\n<p>In most cases, the issue is related to PATH configuration. Knowing how to add Python to PATH is one of the first tasks every Python developer should grasp. This allows your operating system to find Python automatically whenever you run a command.<\/p>\n\n\n\n<p>Whether you&#8217;re learning Python, building automation scripts, working with data science tools, or developing applications, setting PATH correctly makes development smoother from the start.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>TL;DR<\/strong><\/h2>\n\n\n\n<ol>\n<li>Adding Python to PATH allows you to run Python commands from any Command Prompt or Terminal window.<\/li>\n\n\n\n<li>If Python is not added to PATH, you may see errors like &#8220;Python is not recognized&#8221; or &#8220;command not found.&#8221;<\/li>\n\n\n\n<li>Windows users can add Python to PATH during installation or through Environment Variables later.<\/li>\n\n\n\n<li>macOS and Linux users can update their shell configuration files to include Python&#8217;s installation directory.<\/li>\n\n\n\n<li>Verifying the configuration ensures that Python, pip, and related tools function correctly from the command line.<\/li>\n<\/ol>\n\n\n\n<div class=\"guvi-answer-card\" style=\"margin: 40px 0;\">\n\n  <div style=\"\n    position: relative;\n    background: linear-gradient(135deg, #f0fff4, #e6f7ee);\n    border: 1px solid #cfeedd;\n    padding: 26px 24px 22px 24px;\n    border-radius: 14px;\n    font-family: Arial, sans-serif;\n    box-shadow: 0 6px 16px rgba(0,0,0,0.05);\n  \">\n\n    <!-- Top accent -->\n    <div style=\"\n      position: absolute;\n      top: 0;\n      left: 0;\n      height: 6px;\n      width: 100%;\n      background: linear-gradient(to right, #099f4e, #6dd5a3);\n      border-radius: 14px 14px 0 0;\n    \"><\/div>\n\n    <!-- Title -->\n    <h3 style=\"\n      margin: 10px 0 12px 0;\n      color: #099f4e;\n      font-size: 20px;\n    \">\n      Why Should You Add Python to PATH?\n    <\/h3>\n\n    <!-- Content -->\n    <p style=\"\n      margin: 0;\n      color: #2f4f3f;\n      font-size: 16px;\n      line-height: 1.7;\n    \">\n      Adding Python to the PATH environment variable allows your operating system to locate and execute Python from any Command Prompt or Terminal window without requiring you to navigate to the installation directory manually. It also enables tools such as <code>pip<\/code>, IDEs, and development environments to find and use Python correctly. Without Python in PATH, running Python commands may result in &#8220;command not found&#8221; or similar errors, making development workflows less convenient.\n    <\/p>\n\n  <\/div>\n\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Check if Python Is Already Added to PATH<\/strong><\/h2>\n\n\n\n<p>Before making any changes, check whether Python is already configured correctly.<\/p>\n\n\n\n<p>On Windows, open Command Prompt and run:<\/p>\n\n\n\n<p>python &#8211;version<\/p>\n\n\n\n<p>If Python is available, you should see output like:<\/p>\n\n\n\n<p>Python 3.13.2<\/p>\n\n\n\n<p>You can also check the installation location using:<\/p>\n\n\n\n<p>where python<\/p>\n\n\n\n<p>This command shows the path to the Python executable currently in use.<\/p>\n\n\n\n<p>On macOS and Linux, run:<\/p>\n\n\n\n<p>python3 &#8211;version<\/p>\n\n\n\n<p>To find the executable, use:<\/p>\n\n\n\n<p>which python3<\/p>\n\n\n\n<p>If these commands return errors or no results, Python is likely missing from PATH.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Add Python to PATH During Installation on Windows<\/strong><\/h2>\n\n\n\n<p>If you&#8217;re installing Python for the first time, the easiest way is to add Python to PATH during installation.<\/p>\n\n\n\n<p>Launch the Python installer and look for the checkbox labeled:&nbsp;<\/p>\n\n\n\n<p>Add Python to PATH<\/p>\n\n\n\n<p>Check this option before selecting Install Now.<\/p>\n\n\n\n<p>The installer will automatically configure the necessary PATH entries, allowing Python and <a href=\"https:\/\/www.guvi.in\/blog\/what-is-pip-in-python\/\">pip<\/a> to work right after installation.<\/p>\n\n\n\n<p>If you have any queries related to how to install <a href=\"https:\/\/www.guvi.in\/hub\/python\/how-to-install-python-on-windows\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python in Windows<\/a>, you can refer to the guide.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Add Python to PATH After Installation on Windows<\/strong><\/h2>\n\n\n\n<p>If Python is already installed, you can add it to <a href=\"https:\/\/www.guvi.in\/blog\/guide-to-add-python-to-path\/\" target=\"_blank\" rel=\"noreferrer noopener\">PATH<\/a> manually.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Locate the Python Installation Folder<\/strong><\/h3>\n\n\n\n<p>Open Command Prompt and run:<\/p>\n\n\n\n<p>where python<\/p>\n\n\n\n<p>If nothing appears, check common installation folders like:<\/p>\n\n\n\n<p>C:\\Users\\YourUsername\\AppData\\Local\\Programs\\Python\\Python313<\/p>\n\n\n\n<p>or<\/p>\n\n\n\n<p>C:\\Program Files\\Python313<\/p>\n\n\n\n<p>You should also find the Scripts folder inside the Python installation directory.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Open Environment Variables<\/strong><\/h3>\n\n\n\n<p>Search Windows for:<\/p>\n\n\n\n<p>Edit the system environment <a href=\"https:\/\/www.guvi.in\/hub\/python\/variables-in-python\/\" target=\"_blank\" rel=\"noreferrer noopener\">variables<\/a><\/p>\n\n\n\n<p>Open the result and click Environment Variables.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Edit the PATH Variable<\/strong><\/h3>\n\n\n\n<p>Under User Variables, select Path and click Edit.<\/p>\n\n\n\n<p>Choose New and add the Python installation directory.<\/p>\n\n\n\n<p>Then, add the Scripts directory as well.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<p>C:\\Users\\YourUsername\\AppData\\Local\\Programs\\Python\\Python313<\/p>\n\n\n\n<p>C:\\Users\\YourUsername\\AppData\\Local\\Programs\\Python\\Python313\\Scripts<\/p>\n\n\n\n<p>Click OK to save the changes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4: Restart Command Prompt<\/strong><\/h3>\n\n\n\n<p>Close any open Command Prompt windows and open a new one.<\/p>\n\n\n\n<p>Run:<\/p>\n\n\n\n<p>python &#8211;version<\/p>\n\n\n\n<p>If the version number appears, Python has been successfully added to PATH.<\/p>\n\n\n\n<p>You can also download <strong>HCL GUVI\u2019s<\/strong> <a href=\"https:\/\/www.guvi.in\/mlp\/python-ebook\/?utm_source=blog&amp;utm_medium=hyperlink&amp;utm_campaign=How+to+Add+Python+to+PATH+in+Windows%2C+macOS%2C+and+Linux\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Python ebook<\/strong><\/a> to learn more about Python installation, environment setup, PATH configuration, and other essential concepts for getting started with Python.\u00a0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Add Python to PATH in Windows 11<\/strong><\/h2>\n\n\n\n<p>Windows 11 users can access PATH settings through Environment Variables.<\/p>\n\n\n\n<p>Open the Start menu and search for Environment Variables. Find the Path variable, edit it, and add both the Python installation directory and the Scripts folder.<\/p>\n\n\n\n<p>After saving the changes, open a new Command Prompt window and verify the setup using:<\/p>\n\n\n\n<p>python &#8211;version<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Add Python to PATH in Windows 10<\/strong><\/h2>\n\n\n\n<p>The process in Windows 10 is similar to Windows 11.<\/p>\n\n\n\n<p>Access Environment Variables, edit the Path variable, and add the required Python directories. Once done, restart Command Prompt and check the installation.<\/p>\n\n\n\n<p>If set up correctly, Python commands should work from any location on your system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Add Python to PATH in macOS<\/strong><\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Most modern macOS systems use <strong>Zsh <\/strong>as the default shell.<\/p>\n\n\n\n<p>First, locate Python:<\/p>\n\n\n\n<p>which python3<\/p>\n\n\n\n<p>If Python is installed but not accessible globally, update the PATH variable:<\/p>\n\n\n\n<p>echo &#8216;export PATH=&#8221;\/usr\/local\/bin:$PATH&#8221;&#8216; &gt;&gt; ~\/.zshrc<\/p>\n\n\n\n<p>Apply the changes:<\/p>\n\n\n\n<p>source ~\/.zshrc<\/p>\n\n\n\n<p>Then verify the installation:<\/p>\n\n\n\n<p>python3 &#8211;version<\/p>\n\n\n\n<p>If a version number appears, Python has been added to PATH successfully.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Add Python to PATH in Linux<\/strong><\/h2>\n\n\n\n<p>Many Linux distributions come with Python by default, but custom installations might need manual setup.<\/p>\n\n\n\n<p>To add Python to PATH, update your shell configuration file:<\/p>\n\n\n\n<p><strong>echo &#8216;export PATH=&#8221;\/usr\/local\/bin:$PATH&#8221;&#8216; &gt;&gt; ~\/.bashrc<\/strong><\/p>\n\n\n\n<p>Reload the configuration:<\/p>\n\n\n\n<p>source ~\/.bashrc<\/p>\n\n\n\n<p>Verify the setup:<\/p>\n\n\n\n<p>python3 &#8211;version<\/p>\n\n\n\n<p>If the command shows the installed version, PATH is set up correctly.<\/p>\n\n\n\n<p>If you have any queries related to how to install <a href=\"https:\/\/www.guvi.in\/hub\/python\/how-to-install-python-on-mac-and-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python in Linux and macOS<\/a>, you can refer to the guide.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Verify Python PATH Configuration<\/strong><\/h2>\n\n\n\n<p>After updating PATH, confirm that everything works as expected.<\/p>\n\n\n\n<p>Run:<\/p>\n\n\n\n<p>python &#8211;version<\/p>\n\n\n\n<p>Then check the executable location:<\/p>\n\n\n\n<p>where python<\/p>\n\n\n\n<p>Windows users can also check pip:<\/p>\n\n\n\n<p>python -m pip &#8211;version<\/p>\n\n\n\n<p>On macOS and Linux, use:<\/p>\n\n\n\n<p>which python3<\/p>\n\n\n\n<p>These commands confirm that Python and related tools are accessible from the command line.<\/p>\n\n\n\n<div style=\"background-color: #099f4e; border: 3px solid #110053; border-radius: 12px; padding: 18px 22px; color: #FFFFFF; font-size: 18px; font-family: Montserrat, Helvetica, sans-serif; line-height: 1.6; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); max-width: 750px;\">\n  <strong style=\"font-size: 22px; color: #FFFFFF;\">\ud83d\udca1 Did You Know?<\/strong>\n  <p style=\"margin-top: 14px; margin-bottom: 0;\">\n    Many developers assume <strong style=\"color: #FFFFFF;\">Python<\/strong> is configured correctly because it runs without issues inside tools such as <strong style=\"color: #FFFFFF;\">VS Code<\/strong>, <strong style=\"color: #FFFFFF;\">PyCharm<\/strong>, or <strong style=\"color: #FFFFFF;\">Jupyter Notebook<\/strong>. However, these applications often locate Python using their own configuration settings and can function even when Python has not been added to the system <strong style=\"color: #FFFFFF;\">PATH<\/strong>. As a result, Python may work perfectly inside an IDE while commands like <strong style=\"color: #FFFFFF;\">python<\/strong> or <strong style=\"color: #FFFFFF;\">pip<\/strong> fail in <strong style=\"color: #FFFFFF;\">Command Prompt<\/strong> or the <strong style=\"color: #FFFFFF;\">Terminal<\/strong>. This is one of the most common causes of confusion for beginners setting up their Python development environment.\n  <\/p>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Common Python PATH Errors and How to Fix Them<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Python Is Not Recognized<\/strong><\/h3>\n\n\n\n<p>This error usually happens when Python&#8217;s installation directory is missing from PATH.<\/p>\n\n\n\n<p>Check the installation location and confirm it has been added correctly to the PATH variable.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>pip Is Not Recognized<\/strong><\/h3>\n\n\n\n<p>Often, this occurs when the Scripts folder was not added to PATH.<\/p>\n\n\n\n<p>Adding the Scripts directory related to your Python installation usually resolves the issue.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Python Works in VS Code but Not in Command Prompt<\/strong><\/h3>\n\n\n\n<p>VS Code can often find Python automatically, even when PATH is not configured correctly.<\/p>\n\n\n\n<p>If Python works in the editor but not in the Command Prompt, manually adding Python to PATH usually fixes the issue.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Python Opens the Microsoft Store<\/strong><\/h3>\n\n\n\n<p>Some Windows systems use App Execution Aliases that redirect Python commands to the Microsoft Store.<\/p>\n\n\n\n<p>Disabling the alias or setting PATH correctly can prevent this behavior.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Multiple Python Versions Are Installed<\/strong><\/h3>\n\n\n\n<p>When multiple Python versions exist on your system, the <a href=\"https:\/\/www.guvi.in\/blog\/command-line-interface-explained\/\" target=\"_blank\" rel=\"noreferrer noopener\">command line<\/a> may launch a different version than the one you expect.<\/p>\n\n\n\n<p>To check which Python executable is currently being used, run:<\/p>\n\n\n\n<p>where python<\/p>\n\n\n\n<p>On macOS and Linux, run:<\/p>\n\n\n\n<p>which python3<\/p>\n\n\n\n<p>These commands display the location of the active Python installation, helping you identify version conflicts and PATH-related issues.<\/p>\n\n\n\n<p>Curious about how these concepts work in real life? Join <strong>HCL GUVI\u2019s<\/strong> <a href=\"https:\/\/www.guvi.in\/courses\/programming\/python-zero-to-hero\/?utm_source=blog&amp;utm_medium=hyperlink&amp;utm_campaign=How+to+Add+Python+to+PATH+in+Windows%2C+macOS%2C+and+Linux\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Python<\/strong><\/a> course to build Python projects and learn automation, backend development, and data science fundamentals.\u00a0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Adding Python to PATH is one of the most important steps for Python developers. It allows your operating system to find Python automatically, making commands, packages, and development tools available from anywhere on your system.<\/p>\n\n\n\n<p>Whether you&#8217;re writing your first Python script or building large applications, a properly configured PATH can reduce common setup problems and create a smoother development process. Spending a few minutes getting PATH right today can save significant trouble later.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>FAQs<\/strong><\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1780136633586\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>1. What is PATH in Python?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>PATH is a system environment variable that tells your operating system where to look for executable files. Adding Python to PATH allows Python commands to run from any directory.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1780136644427\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>2. Can I add Python to PATH after installation?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Yes. You can update the PATH variable through Environment Variables on Windows or shell configuration files on macOS and Linux.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1780136656345\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>3. How do I check if Python is already added to PATH?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Run python &#8211;version or python3 &#8211;version. If a version number appears, Python is likely set up correctly.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1780136666585\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>4. Why is pip not recognized after installing Python?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>This usually happens when the Python Scripts directory has not been added to PATH.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1780136680909\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>5. Do I need to add both the Python and Scripts folders to PATH?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Yes. Adding both directories ensures that Python, pip, and other command-line tools work properly.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>After installing Python, many users expect commands like python and pip to work right away. However, that&#8217;s not always true. You might see errors such as &#8220;Python is not recognized as an internal or external command&#8221; or &#8220;command not found: python,&#8221; even though Python is already on your system. In most cases, the issue is [&hellip;]<\/p>\n","protected":false},"author":63,"featured_media":115218,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[717],"tags":[],"views":"39","authorinfo":{"name":"Vishalini Devarajan","url":"https:\/\/www.guvi.in\/blog\/author\/vishalini\/"},"thumbnailURL":"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/06\/how-to-add-python-to-path-in-windows-300x115.webp","_links":{"self":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/113104"}],"collection":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/comments?post=113104"}],"version-history":[{"count":4,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/113104\/revisions"}],"predecessor-version":[{"id":115213,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/113104\/revisions\/115213"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/media\/115218"}],"wp:attachment":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/media?parent=113104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/categories?post=113104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/tags?post=113104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}