🌐
Reddit
reddit.com › r/python › why doesnt python add itself to path on windows?
r/Python on Reddit: Why doesnt Python add itself to PATH on Windows?
August 21, 2023 - So you should avoid python and use py instead. We can argue about whether the python launcher was a good idea or not, but given that it exists, it makes sense not to add python to your PATH.
Python 3.8 install path issues Sep 29, 2020
r/learnpython
6y ago
What is the right way to use python on Windows? Apr 7, 2024
r/learnprogramming
2y ago
What is happening? Command line confusion Dec 30, 2025
r/learnpython
10mo ago
I cant download Python with PATH Dec 4, 2024
r/learnpython
last yr.
More results from reddit.com
🌐
Reddit
reddit.com › r/python › windows installer should add `python` to the path variable?
r/Python on Reddit: Windows installer should add `python` to the PATH variable?
November 25, 2017 - There is an option! WOW... Should be ticked by default then? ... I don't think so. ... The latest python puts "py.exe" in C:\Windows, which is already in the path. Associate your files with that or use py filename.py to launch stuff.
🌐
Reddit
reddit.com › r/pythontips › what if you forget to add python to path?
r/pythontips on Reddit: What if you forget to add Python to PATH?
August 20, 2021 -

If you forget to add Python to the PATH, you won't be able to run Python in your command line from any other directory.

You will get a message saying,

'python' is not recognized as an internal or external command.

This is because Windows is trying to search for Python in its PATH variable and is unable to find it.

Here is a step-by-step instruction to add Python to the PATH variable in Windows 10.

  1. Copy the directory to which Python is being installed.

  2. Search for System Properties in the Search Bar.

  3. Click on the "Environment Variables" button in System Properties.

  4. Click on the "Path" variable and then click on "Edit".

  5. Now here's the deal. Pay Attention! Paste the directory path from Step 1 at the top of the list. You can use the "Move up" button to get it to the top. Now click on "Ok".

Now you can open up your command line and run python. The Python interactive shell will open up.

*Here is a little extra tip! *

Add the Scripts folder to the PATH variable too. This is the folder where all your libraries will be installed.

If the instructions are not clear enough for you, you can also check out the visual guide containing images of every step, on my blog for achieving the above objective.

Good luck and let me know!

🌐
Reddit
reddit.com › r/learnpython › is it a good idea to add the python scripts to the path?
r/learnpython on Reddit: Is it a good idea to add the Python Scripts to the PATH?
October 12, 2023 -

yeah, pretty much that.This is because i was having problems to use Scrapy (the term scrapy wasnt recognized in the terminal), and long story short i figured out that the python Scripts folder, which im guessing thats where the pip packages get installed, is not in PATH.

I guess is obvious but i've installed several libraries using pip and ,as you can notice, i dont have much experience in this kind of problems, so i dont have any idea of what things i could mess up by adding the directory to the PATH.

🌐
Reddit
reddit.com › r/learnpython › how do i install python "correctly?"
r/learnpython on Reddit: How do I Install Python "Correctly?"
November 4, 2020 -

I'm working my way through Automate the Boring Stuff and I'm to the part where I have to consult Appendices A and B in order to install new modules and run Python scripts outside of Mu.

I thought I'd installed Python correctly until I reached this point. I'm getting extremely confused by how I'm "supposed" to install python, configure PATH variables, install modules, etc.

For example, I have "python.exe" located in:

C:\Users\myname\AppData\Local\Programs\Python\Python39

But I also have "py.exe" located in:

C:\Windows

From what I understand, I have to run commands starting with "python" from the former location and "py" from the latter location. Am I supposed to have two different locations like this or is this redundant? Did I mess up the installation?

I managed to get the mclip.py project working, however now I'm working on the Zombie Dice project and I'm having issues with installing the module all of a sudden.

For example, I opened the cmd prompt, changed my directory to

C:\Users\myname\AppData\Local\Programs\Python\Python39\Scripts

and used PIP to install the module. However, when I open Mu and run:

import zombiedice
zombiedice.demo()

...I receive an error message:

Traceback (most recent call last):
    File "c:\users\myname\mu_code\test.py", line 2, in <module>
        import zombiedice
ModuleNotFoundError: No module named 'zombiedice'

Why isn't Mu recognizing the zombiedice module after I "successfully" installed it earlier?

Also, when I was installing the module, I received a warning that a newer version of PIP was available so I upgraded PIP. After upgrading, it gave me a warning:

WARNING: The scripts pip.exe, pip3.9.exe and pip3.exe are installed in 'C:\Users\myname\AppData\Local\Programs\Python\Python39\Scripts' which is not on PATH.

Consider adding this directory to PATH

I don't know why it's giving me this warning when I already have this directory on PATH. When I run "echo %PATH%", the directory appears among the list of directories.

This is all extremely confusing and frustrating, constantly having to spend hours going through files, directories, and commands just to get scripts working.

Are Python files, scripts, projects, directories, modules, etc. all supposed to be scattered all across my computer like this? Can't I just have one neat little folder called "Python" somewhere which contains everything? Or do I really have to keep track of where all of these different things are?

Top answer
1 of 4
16
Back in the old days, there used to be one computer in a house with multiple users, nowadays pretty much everyone has its own PC, but you can still have multiple users. First options installs Python for all users, even tho it will probably be just you. PATH is something like a variable in your OS that says where to look for programs, if you open up command prompt and type "program.exe", cmd will go over all entried in PATH and look if it finds "program.exe" in any of those. You probably want to check that one too, doesnt really hurt anything and if you end up running python from terminalm it will be useful for the shell to find Python via PATH.
2 of 4
4
When you type in a command or anything, even just gibberish into a command window, the first thing the command interrupter does is looks to see if it is a built in command, that is a command that the cmd.exe deals with on it's own. Like cd or dir are built in commands. If the command interrupter decides it is not a built in command, it looks in the current directory you are in for whatever you typed, and if it finds it and it is executable, runs it, if it can not find it in the current directory, it looks at an environment variable called the path. This is a list of directories that the command interrupter will look in, in the order they are listed, and it will run the first instance of the executable it finds. If it can not find an executable, it returns an error message. For example if I do: C:\Users\sdr\Downloads>foobar and I have not foobar that is executable in the current director or in my path, it returns an error telling me. Note I may have a foobar that is executable on the system but it is not in my path. 'foobar' is not recognized as an internal or external command, operable program or batch file. If you have a program that will allow you to install different versions, this can get tricky, like if you install two versions of python and add them both to your path, you need to look at your path to see which one it will find and run, it runs the first one it finds. You can also see where a program in your path lives with the where command: C:\Users\sdr\Downloads>where python C:\Users\sdr\AppData\Local\Programs\Python\Python310\python.exe So if I type python, I will run C:\Users\sdr\AppData\Local\Programs\Python\Python310\python.exe even if I have another version installed, and V310 is the first one in my path. If I had another one I probably should remove it from my path as it will not ever run by just typing it and it just makes the path longer and more complicated. Linux is very similar but a bit different, different delimiter between path components and by default it does NOT look in the current directory, that is why you see ./command a lot in linux and you never see .\command in windows. the . means the current directory, do ./command means that command in the current directory. BTW, I would strongly recommend anaconda over python. But YMMV.
🌐
Reddit
reddit.com › r/learnpython › adding .py to path?
r/learnpython on Reddit: Adding .py to PATH?
August 29, 2021 -

So I have been using a python script that I found called sherlock, and I love it. I ended up writing a new script that utilizes the Sherlock script to make using it in cmd easier. And recently i have been starting to learn about environment variables, specifically the PATH environment variable. Is there any way that I can add a .py file to the PATH variable so that I can just type "sherlock <usrname>" and have it work? Instead of having to cd to the directory and typing "python3 sherlock.py <usrname>"?

Find elsewhere
🌐
Reddit
reddit.com › r/learnpython › the absolute maze that is installing python and path variables
r/learnpython on Reddit: The absolute maze that is installing python and path variables
January 28, 2022 -

I've installed python on 1 computer successfully after hours of reading stackoverflow suggestions, youtube videos, documentation etc. And after getting it on there and working I was so frustrated and lost that I had no idea what actions from which source actually worked.

Can someone walk me through this from step 1 why python never works after running the installer and needs all sorts of pointer adjustments in the PATH variable or X other variable like PYTHON PATH to places I can't even manage to keep track of? More specifically, today with a fresh install, what needs to be done to get python to actually install and be detectable by commands.

I'm obviously new, and mostly illiterate to the command prompt so that's part of my difficulty with going through stack overflow where answers 1 through 5 all do something completely different all in command prompt with various opaque arguments, hidden references, implied actions, implied paths etc.

🌐
Reddit
reddit.com › r/learnpython › windows install - risks of adding to path?
Windows install - risks of adding to PATH? : r/learnpython
November 2, 2020 - If you plan on using IDLE or VSCode for all your coding then there isn't much need to add python to PATH.
🌐
Reddit
reddit.com › r/ece › i am a little confused about adding to “path”which i keep on hearing in python or matlab programming. what exactly is adding something to path mean?
r/ECE on Reddit: I am a little confused about adding to “path”which I keep on hearing in python or matlab programming. What exactly is adding something to path mean?
June 6, 2022 - To facilitate this, you add to the $PATH variable to let the system know where to look, such that it knows what you mean when you type "java --...." or "python ..." On windows, press the windows key and type env, and select edit the system ...
🌐
Reddit
reddit.com › r/learnpython › set up python for windows 10
r/learnpython on Reddit: Set up Python for Windows 10
September 11, 2016 -

Hi, I just began working with Python in University and now I wanna set up Python on my home PC which is running Windows 10. I would like to use "Atom" as text editor. The problem is that I cann't run Python scripts. I am getting an error:

Unable to find command: python Are you sure PATH is configured correctly?

I actually don't really know how to configure PATH. I created a new System variable, but I am not sure if it has to have a specific name and which value it's need to have.

I downloaded Python 3.5.2 from the official site: Python

So, does anyone know how to set up Python on Windows 10 correctly?

🌐
Reddit
reddit.com › r/python › python and the path variable in windows 10
r/Python on Reddit: Python and the PATH variable in Windows 10
August 20, 2021 -

Do you remember checking the box in the image shown below to add your Python installation to PATH in Windows 10?

Adding Python to PATH

Well, I was curious! What if someone accidentally forgot to check that little radio button? What would be the possible recovery steps?

So I spent my evening yesterday uninstalling Python and re-installing to figure out a way to add Python to the PATH post-installation.

If you forget to add Python to the PATH variable, you won't be able to run Python in your command line.

You will get a message saying,

‘python' is not recognized as an internal or external command.

Here are the steps I used to add Python to the PATH variable in Windows 10.

  1. Copy the directory to which Python is being installed.

  2. Search for System Properties in the Search Bar.

  3. Click on the "Environment Variables" button in System Properties.

  4. Click on the "Path" variable and then click on "Edit".

  5. Now here's the deal. Paste the directory path from Step 1 at the top of the list. You can use the "Move up" button to get it to the top. Now click on "Ok".

I found out that if you paste the path at the end, it still doesn't work. Can someone tell me why?

Anyways, if the steps are not clear to anyone, here is a visual guide containing images of every step, on my blog for achieving the above objective. If you are interested, do take a look.

🌐
Reddit
reddit.com › r/learnpython › why does the miniconda installation not recommend you add it to path, yet after you finish the installation you have to manually add it to path to get it to work?
r/learnpython on Reddit: Why does the Miniconda installation not recommend you add it to PATH, yet after you finish the installation you have to manually add it to PATH to get it to work?
May 20, 2023 -

I installed Miniconda and did not check the "add to PATH" setting because it was not recommended. But now I can't access Anaconda Prompt or load any libraries. So I'm a little bit confused by it was not recommended during the installation?

I'm considering just uninstalling Miniconda and reinstalling it and have the installation add it to PATH since the manual way of doing it is a bit too confusing for me...

Top answer
1 of 3
6
What OS are you running? I'm assuming windows because you're struggling, and it's generally more difficult to get set up correctly there. If you add python to path, it may find your python installation before it finds the "system python" . To the best of my knowledge, this was mostly a Linux/MacOS/Unix system issue, where most of the installations would come with a pre-installed system python. When python went from python 2 to Python 3, this was a pretty serious breaking change. So if you had "python" added to your path as python 3, and a software attempted to call "system python" expecting the python call to execute python 2, the software (your os itself in some cases) would break. In Linux, that could potentially be critical system software that is necessary for the OS to function. It would be great to say OS developers learned from this, and introduced safeguards against it, but realistically, it's not a simple issue to solve. If your system python is set to python 2.7, 3.6, or 3.10, you should leave it that way. Windows doesn't have a system python, but some third party applications may be installing python and adding it to Path, despite it not being a 'best practice'. Adding to path wouldn't be a good practice, because once two sets of software both choose to do that, you'll run into conflicts when one calls python expecting python 3.10, and instead gets python 3.6. this is why it's so heavily encouraged to use "virtual environments", so that you isolate the software you're writing from system software that may be built on dissimilar versions of python or python packages. That way, when your OS calls python expecting python 2.7, it will still get it correct. On windows, as others have mentioned, it's typically recommended to run it from within the "anaconda prompt", which is generally saved in the start menu under an anaconda folder, which is preconfigured to point to anacondas version of python first. If you want to run python directly in CMD or PowerShell, then you probably have to add it to path. But again, it will potentially cause conflicts, depending on the particular OS you're running.
2 of 3
1
But now I can't access Anaconda Prompt is it not there on your menu ? O go to my menu, I open Anaconda Prompt, I type python, I program
🌐
Reddit
reddit.com › r/linux4noobs › issues when adding python to path
r/linux4noobs on Reddit: issues when adding Python to PATH
March 18, 2024 -

Hi all, I'm trying to install some python libraries that I need on my computer (running Kubuntu 22.04.4) and I added to PATH the following:

export PATH="$PATH:/usr/local/bin/python"

in order to be able to use these packages and I got no problems with it.

When I installed jupyter-lab I got a warning message telling me to add /home/[user]/.local/bin to the PATH but when I add it to my ~/.zshrc file I lose the ability to use any other command (like sudo, apt-get, mkdir and so on)

I really need to use jupyter so if anyone has some ideas please help me

Thank you in advance!

🌐
Reddit
reddit.com › r/learnpython › what does pythonpath=. do?
r/learnpython on Reddit: What does PYTHONPATH=. do?
January 20, 2017 -

I've often times run these commands blindly: export PYTHONPATH=. or PYTHONPATH=.. but I don't understand what they're doing...?

Top answer
1 of 2
2
It sets the path where Python looks for modules to the current directory or the directory one level above current. Why are you running those commands?
2 of 2
1
export creates or changes an environment variable for the current session in your operating system. ctrl-f for that particular one here to see what it means/does/is: https://docs.python.org/3/using/cmdline.html "." and ".." are coming from the relative path tradition. "." means "current directory" and ".." means parent directory (of the current directory). There is also "~" (for linux) which means "home directory" (which expands to "/home/your_user_name"). You can find more information about that here: https://en.wikipedia.org/wiki/Path_(computing)#Absolute_and_relative_paths You should not need to set these yourself, in almost all cases. I would look into how pip and virtualenv are used. The former installs libraries where python would expect to find them. I usually use it as python -m pip install some_library The latter creates a virtual environment (inside a folder) and puts basic libraries in it. virtualenv venv/ # create the venv directory in the current directory and copy over basic python stuff, for linux virtual venv\ # same as above if using Windows source venv/bin/activate # for linux, activate that virtual environment venv\Scripts\activate.bin # same as above if using Windows which python # in linux, check where your default python is; first executable listed should be the one inside venv/ or something is wrong where python # same as above, if using windows python -m pip install some_library # installs library inside that virtual environment/directory pip freeze > requirements.txt # records which libraries are installed; would in turn be used to install those libraries in another system/computer your_favorite_ide your_code.py # start editing your code using your virtual environment (if you're using Emacs, look into Elpy instead of this part; other IDEs also have their own way of configuring where the virtual environment is)