Sublime Forum

Sublime Portable building with Python

#1

I started playing around with Python and Sublime Text 2 today. I have my Sublime installation as portable. I’ve installed Python 3.2 and put the necessary C:\Python32\ in both the system and user environmental variables for PATH. I verified in command prompt the changes were correct with the python interpreter snapping to action. However, the CTRL + B command with sublime text fails with a python script opened and in focus.

The error is this:

[quote][Error 2] The system cannot find the file specified
[cmd: [u’python’, u’-u’, u’Y:\\Path\\To\\My\\Stuff\\blah.py’]]
[dir: Y:\Path\To\My\Stuff]
[path: C:\Program Files (x86)\ActiveState Komodo Edit 7;C:\ColdFusion9\verity\k2_nti40\bin;G:\Utilities\Windows Resource Kits\Tools;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Microsoft Windows Performance Toolkit;C:\Program Files\jEdit;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files (x86)\Tesseract-OCR;C:\Program Files (x86)\Nmap;C:\Program Files (x86)\smartmontools\bin;C:\Program Files\Oracle\VirtualBox]
[Finished][/quote]

I notice a lacking environmental variable I had put in for Python. I even restarted sublime text to verify the path was updated at process runtime.

The original Python.sublime-build was this:

{ "cmd": "python", "-u", "$file"], "file_regex": "^ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python" }

Changing the Python.sublime-build to this:

{ "cmd": "C:\\python32\\python", "-u", "$file"], "file_regex": "^ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python" }
results in success.

adapted from source:
stackoverflow.com/questions/8551 … ime-text-2

So, my questions…

Why is my PATH environmental variable being ignored?
How can I do this without having to modify the Python.sublime-build file?

0 Likes