Sunday, February 24, 2013

Ubuntu Sublime Python Env


1) Change Environment Path
Find the file named "Python.Sublime-build":
{
    "cmd": ["python", "-u", "$file"],
  "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
Change the Python path to yours in the Environment like:
{
"cmd": ["/home/hiddenghost/pyenv/bin/python", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}

2) Python Project Configuration Example
With the project name --> "*.sublime-project"
{
"folders":
    [
        {
            "path": "/home/hiddenghost/Documents/hiddenghost"
        }
    ],
    "build_systems":
    [
        {
       "name": "Run Tests",
        "env":
        {
        "PYTHONPATH": "/home/hiddenghost/pyenv/bin/python:/home/hiddenghost/pyenv/lib/python2.7/site-packages"
        },
       "working_dir": "/home/hiddenghost/Documents/hiddenghost",
       "cmd": ["/home/hiddenghost/pyenv/bin/python", "$file"],
       "selector": "source.python"
   }
    ]
}


No comments:

Post a Comment