Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I type 'python' at the command line it says ''python' is not recognized as an internal or external command...'

I have Python in both User and System paths. In the past I have been able to run python from the command line, but suddenly today I can't.

I'm using Windows 7 32-bit.

Does anyone know what the problem could be?


share|improve this question

migrated from Jun 23 '13 at 14:31

This question came from our site for professional and enthusiast programmers.

echo %PATH% What's the result? – hbprotoss Jun 23 '13 at 9:48
C:\Python27;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTE‌​MROOT%\System32\WindowsPowerShell\v1.0\;Python27\Scripts;C:\OpenSSL-Win32; – user2513306 Jun 23 '13 at 10:28
so solution was you didn't have python.exe so had to reinstall. You'd have found that with basic troubleshooting, by trying to run python.exe from its location, without the path and seeing if that worked. it's a basic step. – barlop Jun 13 '15 at 19:16

Lets assume that you installed python in the default location.

try adding this into your system environments.

value: C:\Python27\;C:\Python27\Lib;C:\Python27\include;C:\Python27\DLLs;C:\Python27\Scripts;C:\Python27\Lib\site-packages

Note: when you create a PYTHONPATH environment variable it might effect some other application to forcefully use this version of python instead their own.

share|improve this answer
PYTHONPATH won't help with finding the python.exe executable. – Frank Osterfeld Jun 23 '13 at 12:43

The python install directory on Windows should have the following files (ignore the pyscopg and pillow files):

Python directory listing

Your PATH environment variable should be like the below if you have install Python2 at the default location:


You should also have the following in PATHEXT:


I noticed in your environment variables you have Python27\Scripts; which is not correct. Try fixing that, and you'll have to close any command prompts if you change any environment variables. If the settings are as the above and you still can't run Python, do a re-install.

share|improve this answer
Thanks, I've reinstalled Python now and it's working. – user2513306 Jun 23 '13 at 10:59

This seems to be a problem in the PATH environment variable. To confirm that, in cmd try the following:

If you are using Python 2.7:

SET PATH=%PATH%;C:\Python27

If you are using Python 3.3:

SET PATH=%PATH%;C:\Python33

And then: python something

share|improve this answer
The output is the same ''python' is not recognized as an internal or external command...' – user2513306 Jun 23 '13 at 10:23
could you check if you have python.exe inside this folder c:\Python27 – Saullo Castro Jun 23 '13 at 10:40

python is clearly NOT in your PATH variable. You can confirm this 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.

share|improve this answer
I don't seem to have a python.exe file, only pythonw.exe. Is this the problem? It's not in my recycle bin so I haven't accidentally deleted it. – user2513306 Jun 23 '13 at 10:16
I don't have a windows with me right now, but I'm pretty sure there should be a python.exe, and if you can't find it then something's wrong. Try to reinstall it. – janos Jun 23 '13 at 10:25
thanks, I think I'll have to do that – user2513306 Jun 23 '13 at 10:35

Try closing the command prompt window and opening again, then trying. Worked for me.

share|improve this answer

Most common mistake!!

Developers forget to set this "C:\Python27\" in PATH variable assuming "C:\Python27\Lib" is enough.

Both path should be present

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.