Skip to content Skip to sidebar Skip to footer

Sublime Text 2 & Pythonpath

When running a python script on Sublime Text 2 (OSX), the python interpreter works (using Enthought Python Distribution) but not my own PYTHONPATH. Here's what the Python.sublime-b

Solution 1:

I'm working with SublimeText2 build 2202 (I have a license and I can download all the "nightly" releases) and I add an "env" attribute to the builder.

For example:

{
    "path": "/Library/Frameworks/EPD64.framework/Versions/Current/bin/",
    "cmd": ["python2.7", "-u", "$file"],
    "env":
    {
        "PYTHONPATH": "path/to/a/folder:path/to/another/folder",
    },    
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

Whatever values you set in this way will be prepended to the PYTHONPATH that Sublime sees.

Your problem was a little different, but I thought that knowing this could be helpful.

Solution 2:

In my mac, I need to add a comma after the back brace of "env"

{
    "path": "/Library/Frameworks/EPD64.framework/Versions/Current/bin/",
    "cmd": ["python2.7", "-u", "$file"],
    "env":
    {
        "PYTHONPATH": "path/to/a/folder:path/to/another/folder",
    },    
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

Solution 3:

The setup was correct from above, but my system has to be restarted. Once that was done everything was working.

Post a Comment for "Sublime Text 2 & Pythonpath"