Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add python to cmd in windows [closed]

I have python 3.1 installed, and I have added it to the system path too. Now I can open "cmd" and type python to start python, but whenever I try to open cmd in a specific directory by using (shift + right click -> open command prompt here), and type python, it says "command not found"!

How can I fix this?

like image 980
srisar Avatar asked Feb 03 '11 05:02

srisar


People also ask

How do I enable Python in cmd?

To start a Python interactive session, just open a command-line or terminal and then type in python , or python3 depending on your Python installation, and then hit Enter .

Why is Python not showing in cmd?

The “Python is not recognized as an internal or external command” error is encountered in the command prompt of Windows. The error is caused when Python's executable file is not found in an environment variable as a result of the Python command in the Windows command prompt.

How do I stop Python from closing immediately?

The solution I use is to create a bat file. When you run the bat file it will run the python program and pause at the end to allow you to read the output. Then if you press any key it will close the window. Save this answer.

How do I open a Python file in cmd?

Enter the "python" command and your file's name. For example, if your Python file is named "script", you would type in python script.py here. If your Python file has one or more spaces in its name, you'll place quotation marks around the file name and extension (e.g., python "my script.py" ).


1 Answers

Right click on my computer>got to properties>advanced settings>environmental variables>

choose path and add the installed python dirtory to that path as like below:

C:\WINDOWS\system32;C:\WINDOWS;C:\Python27

like image 80
swastik Avatar answered Sep 28 '22 12:09

swastik