Reputation: 2012
I am on OSX and I have two virtual environments setup for Python 2.7 and 3.x
These were installed using homebrew following this guide, which seems to setup my bash environment correctly.
I am encountering a brick wall with the anaconda user configuration though. Here is my user configuration:
{
"python_interpreter": "$VIRTUAL_ENV/bin/python",
"display_signatures": true,
"pep8_max_line_length": 120,
}
This is my bash output for $VIRTUAL_ENV. I am running sublime from my bash terminal.
$ echo $VIRTUAL_ENV
/Users/rpg711/.virtualenvs/python3
This is my sublime console output for a test build using the anaconda build environment:
/bin/bash: /bin/python: No such file or directory
Here it seems to be looking for /bin/python, as if $VIRTUAL_ENV is evaluating to an empty string.
And the final sanity check... everything seems to be fine here:
(python3) $ python --version
Python 3.6.1
(python3) $ which python
/Users/rpg711/.virtualenvs/python3/bin/python
Anyone know what is going on here? I might be doing something wrong.
Upvotes: 3
Views: 1692
Reputation: 2012
Sublime project settings override the user config weirdness. This is the only way to be sure that each project is being developed with the correct virtual environment interpreter. Still launching sublime from a shell with the virtual environment activated.
I used
"settings": {
"python_interpreter": "~/.virtualenvs/[envname]/bin/python"
}
As long as the .sublime-project
file exists, no issues with anaconda interpreter.
Upvotes: 1