Hello. I have been trying to run a simple script in Windows 7 DOS using the python command, but it returns this error message:
'python' is not recognized as an internal or external command, operable program, or batch file.
I've looked up how to fix on Google, but I can't find anything specifically for Windows 7 and this issue.
Please help and thank you in advance!

What version have you installed from http://python.org/download/ and does your current path include the installation location? Do you have PYTHONPATH set?

I have version 3.2 installed and no, I don't think so. How do I set PYTHONPATH?

Hello. I have been trying to run a simple script in Windows 7 DOS using the python command

Dont call it DOS because it`s a long time since windows had DOS.
Windows 98 is the last version based on MS‑DOS.

Command Prompt is sometimes incorrectly referred to as "the DOS prompt" or as MS-DOS itself. Command Prompt is a Windows program that emulates many of the command line abilities available in MS-DOS but it is not actually MS-DOS.

How do I set PYTHONPATH?

Add PYTHONPATH to Environment Variables.
To path add ;C:\python32\;C:\python32\scripts;
If install in other folder than this(default),type in correct path to that folder.
A good python editor make it easier to run code,look at pyscripter.

So, I tried running a script and while the python command works now, it says this:
python: can't open file 'Hello_world.py' [Errno2] No such file or directory
I've tried adjusting the Path and PYTHONPATH environment variables but it won't work.
I'm not sure how to get it directed to the folder I want.
Please help.

Could you post exactly what you did? You can go Advanced Editor and attach JPG screen capture of Alt-PrintScreen (which by the way works beautifully in Linux, hope Microsoft has impoved it in Windows7, I still us WindowsXP) window capture saved in file.

Edited 5 Years Ago by pyTony: n/a

First I created the PYTHONPATH variable, and I put C:\python32;C:\python32\projects (where I keep my scripts). That didn't work, so I put that into the Path variable. While it got python working, it couldn't find the files I wanted to use in the projects folder.

Edited 5 Years Ago by Joeflims: n/a

If you are working from the command prompt, change directory to the location of your script and try again. OR stay where you are and invoke python on the full path of the script: python C:\joeflims\pywork\one\script1.py

Just a note,dont use singel \ it can be used as an escape character.
For windows always python C:\\my_script\\script.py or python C:/my_script/script.py

Edited 5 Years Ago by snippsat: n/a

This question has already been answered. Start a new discussion instead.