1

So for some reason, my computer refuses to see the environment PATH variable. In the path variable, I have:

C:\Python32;

listed, along with all of the other programs, but it doesn't work if I type, "python" into the command window. However, I can type "python" into the run window, and have it run the correct interpreter (I assume because I have an environment variable for that separately...? As you can see, I don't quite understand how to customize this stuff. Any help would be appreciated!

asked Oct 12, 2011 at 16:23
2
  • 3
    docs.python.org/using/windows.html Commented Oct 12, 2011 at 16:25
  • Tried both your and lc's ideas, but it didn't work. I have the Python path listed in my environment PATH list, but typing 'python' into the command window doesn't work. I guess the real question is, "How would I configure my path variables so that I could type 'python' into a command window and start up my Python installation present in C:\Python32?" Commented Oct 12, 2011 at 18:11

5 Answers 5

4

I faced the same issue.

However, in my case, I went through the documentation from python and found where I was making mistake. In the latest python versions, if you type 'python' in cmd, it will show error. At the same time, the command that worked for me was 'py'.

So I recommend anyone facing a similar problem to try this - 'py'

Tobias
9693 gold badges14 silver badges31 bronze badges
answered Dec 10, 2018 at 15:35
Sign up to request clarification or add additional context in comments.

3 Comments

Please have a look at this answer: py is the Python launcher which is a utility that comes with Python installations on Windows. So, python and py are two different things. You should always be able to launch python if you have it on %PATH%.
That was a very useful answer. So, is it safe to assume that we can use 'py' also in the same way as python. I mean, can we perform everything using the launcher also?
The launcher can be seen as an enhancement. So, it is able to do things a bare bone Python does not, such as choosing a python version If you have several versions installed or virtual commands from shebang lines. Basic info here, detailed info here. Since the python launcher is an optional component, I would not recommend to rely on it.
3

I know it's been a while, but I hope this could help someone else.

I had the same problem and the only way to making it work was running cmd or powershell as administrator.

answered Apr 15, 2012 at 18:40

Comments

2

You can confirm if python is in your environment variables by looking at the output of echo

%path%

Keep in mind that after editing the PATH variable using the control panel, you have to open a new terminal, as the setting will NOT be updated in existing terminals.

Another possibility is that you added the wrong path to the PATH variable. Verify it.

The bottom line is, if the directory of your python.exe is really in PATH, then running python will really work.

answered Jul 11, 2014 at 14:23

Comments

0

Try what is written here on the official documentation.

answered Oct 12, 2011 at 16:27

2 Comments

Note that if you're using Windows 7, you have to add a step. After clicking "Properties", click the "Advance System Settings" link on the left of the window. Then you can go to the "Advanced" tab and continue from there.
Tried it, but it didn't work. :( Thanks for the effort though. EDIT: By 'It', I mean that I tried 'set PYTHONPATH = %PYTHONPATH%; C:\Python32', but calling the 'python' command still didn't work. Any other ideas? Or possibly a more precise place to point me?
0

I faced the same problem. Add more specific folders to your path. For example I added this and it seemed to work out! :)

C:\Python35-32;C:\Python35-32\Lib\site-packages\;C:\Python35-32\Scripts\;

To check if it is set successfully, type python in command prompt

enter image description here

QoP
28.5k16 gold badges78 silver badges77 bronze badges
answered Jun 14, 2016 at 7:46

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.