I have different virtualenv\'s (made with virtualenwrapper) and I\'d like to be able to specify which virtualenv to use with each proj
I have an alternative. Just creating a new 'Build System' which runs as if in the virtual environment. Here we call it 'my_python'. The aim is to use this build system to run my script directly without leaving sublime. You need to:
preferences->Browse Packages. This will open a folder under which lies setting files. Go inside dir User and create a new file named my_python.sublime-build (composed of the build system name followed by .sublime_build. After doing this, go to Tools -> Build System and you will see a new option my_python.Add the following JSON settings to that file.
{
"shell_cmd": "/Users/Ted/bsd/vector/.v_venv/bin/python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
Inside shell_cmd, change /Users/Ted/bsd/vector/.v_venv/bin/python to the path of your python virtual environment.
Then just use the short key to build your script.
When you want to change your virtual environment, just copy its path to the setting file and all done. Maybe the approach seems containing a lots of work, but it works well and convenient.