- OS: Bigsur 11.3.1
- Sublime text: 3.2.2
- Sublime text extension(package): Anaconda
- Python virtual environment management using
Miniconda
(Anaconda
) - Use autoenv per each workspace directory
When I open the workspace folder and work on it in Sublime text, I usually go to the directory via Terminal(using cd
) and use subl .
to open it. (If I moved to the directory, its virtual environment would be activated cuz I used autoenv
mentioned above)
And In the package settings(User's custom setting) of Anaconda, I can set python_interpreter
, so whenever I use a function like Go to definition
of the Class
of 3rd party library, it reflects its installed libraries and get me there. The setting looks like this: "python_interpreter": "/Users/chois/miniconda3/envs/MY_VIRTUAL_ENV_NAME/bin/python"
But the problem is, it is set with "python_interpreter": "/Users/chois/miniconda3/bin/python"
as a default, which is a (base)
interpreter, not a virtual environment of the directory. So whenever I worked on that workspace, I had to manually change it.
What I tried is something like "python_interpreter": "/Users/chois/miniconda3/envs/$VIRTUAL_ENV/bin/python",
but the sublime text doesn't recognize the environment variable in the package setting.
How can I flexibly set python_interpreter
as each working directory's virtual environment's interpreter path, say, "/Users/chois/miniconda3/envs/$CURRENT_DIRS_VIRTUAL_ENV_NAME/bin/python"
?