How to set default environment location

Dear

I am a beginner in Anaconda.

I learned how to create a new env project using spyder but, every new project has env under c:\users\myusername.conda\env.

First, I would like to edit this path. Secondly, I would like in which configuration archive file I can modified this default path.

I solved partially this problem using cmd prompt line:

conda create --prefix d:\users\myusername.conda\env (after, I did conda active the env created before) but no modules were added by default.

Please, could you point me directions?

Thanks in advance for your attention

Best regards

Eduardo

Hello Eduardo,

Thank you for reaching out to Anaconda community.

If you want to edit the path that the environment for your Spyder is installed. The command of conda create --prefix /path/to/new/location/env_name is correct.

You can access this environment by conda activate /path/to/new/location/env_name.

Though when you create a new environment path, by default no packages will be installed on the environment. you will need to install the packages you want on your environment.

Further more there is another method, but this will modify the default path of future environments you create.

If you edit your .condarc file and add or modify the envs_dirs section in the .condarc file the following below to the file:

envs_dirs:
  - /path/to/new/envs/location

Note: you can verify the change with the command conda info --envs

Let us know if you have any questions.

This change will setup the envs path to a new location.