I am trying to re-enter my conda environment but I am having trouble doing so as when I type conda activate (evironment name)
or source activate (environment name)
both return the error 'Could not find conda environment.' This is very strange as when I type conda info --envs
, I get this:
# conda environments:
#
base * /Users/(my name)/anaconda3
/anaconda3/envs/(environment name)
Could Not Find Conda Environment Tensorflow? Creating a Python environment using python version 3.7 as well as specific python version tarballs will generate Conda environments. You will need to install tensorflow 2 on your computer in the CUDA environment. How Do You Add Tensorflow To Conda Environment?
the environment is created but has no name. This is confirmed as I get: in the prompt. In addition when using conda env list, the created environment has no name, but does have a path. I still have to update the .condrc to append to the envs_dirs key to add the environment, despite using the latest version of conda.
You can list all discoverable environments with `conda info --envs`. I'm not even sure what debugging steps to take in this case. I've verified that conda comes from the right anaconda path, etc.
Conda enables activation through type *yourenvironmentname> in the command line.It should be noted that this version of conda activates Discovery rather than Discovery.This command will help you to install a particular package.
For a Conda environment to have a name it must be installed in one of the envs_dirs
directories (see conda config --show envs_dirs
). Creating an environment outside of one of those forfeits its "name-ability". Instead, one must use the path (called its prefix) to activate it, e.g.,
conda activate /anaconda3/envs/my_env
Other commands will require one to use the --prefix|-p
flag to specify the environment. See the documentation on "Specifying the location for an environment".
If one plans to frequently install in a different location than the default, then there is an option to add directories to the envs_dirs
configuration variable. In this specific case, this would be
conda config --append envs_dirs /anaconda3/envs
Note that whatever directory one specifies in this command will become the de facto default for future installs using the --name|-n
flag. If one still wants to keep the standard default (/Users/<user>/anaconda3/envs
), then they should follow the above with
conda config --prepend envs_dirs /Users/<user>/anaconda3/envs
That is, this will let one pick up the "names" of the environments installed in /anaconda3/envs
, but calling conda create -n foo
would still create it in /Users/(my name)/anaconda3/envs/foo
.
For documentation, see: conda config --describe envs_dirs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With