When I try to run python or any language through Sublime Text 2, all it says is
[Error 2] The system cannot find the file specified
[cmd: [u'python', u'-u', u'C:\\Users\\Owner\\Desktop\\RandomStuff\\python\\java\\bob.java']]
[dir: C:\Users\Owner\Desktop\RandomStuff\python\java]
[path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Java\jdk1.7.0_03\bin]
[Finished]
I was told to change my build configuration so that the command prompt goes to the python interpreter, but changing the path environment variable does absolutely nothing except add
;C:\Python27\python
to the list. This is really frustrating because I am trying to make a game in Python and I have no idea how to fix this.
The path is a list of directories, not files. You should add c:\Python27
to your path, not c:\Python27\python
.
After installing python from the following link http://www.python.org/download/releases/, you must Update your environment variables:
- click on start
- right click on computer
- click on advanced system settings
- click on environment
- locate path on system variables
- click on edit
- append ;C:\Python32\ to the end of the value or wherever the installer
installed your Python
Make sure you restart sublime after doing this, you will still get an error if you didn't.
The problem is related to the python command not being found in the exectuable path. You could point sublime explicitly to the python executable, or you could just fix the env path. The second is more important to have your general python set up properly.
C:\Python27\;C:\Python27\Scripts\
The first location contains python.exe and the second contains a "python" script that points back to the exe. This will allow a command using "python" to work.