I am new to Anaconda Python and I am setting up a project in Sublime Text 3. I have installed Anaconda and created a virtual environment using:
conda create
If you activate the environment you're interested in, you can find that answer in the environment variables.
on MacOS/Linux:
source activate python35
echo $CONDA_PREFIX
on Windows:
conda activate python35
echo %CONDA_PREFIX%
You can also run conda info --envs
, and that will show the paths to all your environments.
To get the path to the instance of python being used by a particular environment, do the following:
on MacOS/Linux:
source activate python35
which python
on Windows:
conda activate python35
where python
That should return the path you're looking for.
On Windows 10 x64 and Anaconda3, the python interpreter for a newly created environment "my_env" would appear here:
C:\ProgramData\Anaconda3\envs\my_env\python.exe
Or here:
C:\Users\[username]\AppData\Local\conda\conda\envs\my_env
Check both places.
None of the other windows solutions worked for me so I'm providing my own. Activate the environment inside anaconda prompt, then issue the command 'where python' and you'll likely see multiple results but one of them, most likely the top one, is the one you're after. For me, my environments were located in AppData\Local... which is not what anyone else had mentioned but the best solution is to use 'where python' which should result in an answer regardless of how you've installed Anaconda.
For me, with default anaconda settings and Windows 10, the path that displays after activating the environment is C:\Users\usrname>
, but it does not contain an Anaconda3 folder. However, it contains a .conda
folder that contains an environments.txt
file that lists all conda environments and their locations. By default, the environment folders were stored in:
C:\Users\usrname\AppData\Local\conda\conda\envs\EnvName
enter image description here
enter image description here
enter image description here
To answer your question the folder for your python binaries and packages for the environment are located in ~Anaconda_installation_folder~/envs/python35
.
But I cannot really say if that solves your problem. Normally you just switch to your environment source activate python35
and then type python
. This will automatically give you the "right" python executable. So if you have a package you could use:
source activate python35
python setup.py install
# Now it is installed in your python35 environment
source activate python27
python setup.py install
# Now it is also installed in your python27 environment
Just change python setup.py install
to what you want to do in the environment. I don't have any experience using Sublime Text and what you mean with build system
. But you can always use something like tox which automates a lot of these manual builds.