How do I change my build configuration so that cmd points to actual location of the python interpreter?

后端 未结 3 971
猫巷女王i
猫巷女王i 2021-01-19 04:35

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\'-         


        
相关标签:
3条回答
  • 2021-01-19 05:24

    After installing python from the following link http://www.python.org/download/releases/, you must Update your environment variables:

    1. click on start
    2. right click on computer
    3. click on advanced system settings
    4. click on environment
    5. locate path on system variables
    6. click on edit
    7. 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.

    0 讨论(0)
  • 2021-01-19 05:26

    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.

    0 讨论(0)
  • 2021-01-19 05:37

    The path is a list of directories, not files. You should add c:\Python27 to your path, not c:\Python27\python.

    0 讨论(0)
提交回复
热议问题