Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anaconda Python: where are the virtual environments stored?

People also ask

Where are Python virtual environments stored?

The virtual environment tool creates a folder inside the project directory. By default, the folder is called venv , but you can give it a custom name too. It keeps Python and pip executable files inside the virtual environment folder.

Where can I find virtual environment?

how can I find the path of virtualenv python ,built with this tutorial? Activate the created env first: workon cv . Then issue which python , this will show you the path to the executable. Also, when an env is activated, issuing echo $VIRTUAL_ENV will show you the path to the directory containing env files.

How do I find the virtual environment in Anaconda prompt?

Press the "Windows" icon in the lower corner of the screen to open the "Search" box. Type "Anaconda Navigator" and then hit "Enter" to open it. Move to "Environments," where two virtual environments are shown. ' base' is the default, whereas 'env' is the previously created Virtual Environment.


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.


You can run the command conda info.

This will output something like this:

envs directories : C:\Users\Geo\.local\Miniconda3\envs
                   C:\Users\Geo\.conda\envs
                   C:\Users\Geo\AppData\Local\conda\conda\envs

I have installed conda at C:\Users\Geo\.local\Miniconda3.

Then with the command conda info -e you get the location of each environment.

(base) C:\Users\Geo>conda info -e
# conda environments:
#
miniconda2               C:\Users\Geo\.conda\envs\miniconda2
base                  *  C:\Users\Geo\.local\Miniconda3
anaconda3                C:\Users\Geo\.local\Miniconda3\envs\anaconda3
ml                       C:\Users\Geo\.local\Miniconda3\envs\ml

Your environments are located in Anaconda3\envs\<yourEnv_directory>\


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.


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.