3

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?

2 Answers 2

1

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"
}
Sign up to request clarification or add additional context in comments.

Comments

0

env needs to be a JSON object, or dictionary if you will, like this:

  "env":
    {"PYTHONPATH":"/usr/local/lib/python:/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages"},

1 Comment

What config file we should include this JSON object to?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.