Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Sublime Text read PYTHONPATH environment variable on Windows

There are several online resources describing how to make SublimeText read PYTHONPATH variable specified in Windows Start menu > Control Panel > System > Advanced Settings > Environment Variables.

Yet, none of them clearly describe how to customize Sublime in Windows. How do we do it?

like image 646
alphanumeric Avatar asked May 19 '26 17:05

alphanumeric


1 Answers

If using python 3.x you need to edit the Python3.sublime-build (Preferences > Browse packages > Python 3)
to look like this:

{
"path": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
"env":{"PYTHONPATH":"/usr/local/lib/python:/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages"},
"cmd": ["python", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
like image 185
Tanvi B Avatar answered May 21 '26 07:05

Tanvi B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!