News from this site

 Rental advertising space, please contact the webmaster if you need cooperation


+focus
focused

classification  

js(0)

jk(0)

tag  

js(0)

date  

no datas

解决新创建的anaconda环境在C:\Users\xxx\.conda\envs\,而不在anaconda安装目录下的envs中

posted on 2023-05-21 17:01     read(1058)     comment(0)     like(8)     collect(1)


Problem Description

When debugging the code of a model today, you need to create a new anaconda environment, and the newly created environment was previously in the envs under the anaconda installation directory, but today it is created in C:\Users\xxx.conda\envs \, as shown in the figure below:
insert image description here
This is very uncomfortable. First of all, not to mention taking up system disk resources, it is also in two locations with the previous environment, which is not convenient for management.

problem analysis

The judgment should be that the envs path under the anaconda installation directory was not found when it was created.

Solution

There is a .condarc file under C:\Users\username, open it, and add the following content at the end of it:

envs_dirs:
  - E://Env//anaconda//envs

This path is set according to your own situation. My anaconda is installed under E:\Env\anaconda, so the storage location of the environment is the path above.
Pay attention to change the dividing line of the path to double slashes


Create the environment again at this time, and find that it is still in the directory of the C drive, but through

conda config --show

See that the configuration has taken effect, as shown in the figure below:
insert image description here
insert image description here
You need to add an execution permission to the envs file:
right-click envs----select attribute
insert image description here
security----edit----Users----select all Users permissions —OK
insert image description here
At this point, the permissions have been added, and the path of the created environment has also been added. After re-creating the environment, it is found that it is no longer in the C drive, but in the installation directory of our custom anaconda. As shown in the figure below:
insert image description here
So far the problem has been solved.

References

https://blog.csdn.net/QH2107/article/details/126246310



Category of website: technical article > Blog

Author:mmm

link:http://www.pythonblackhole.com/blog/article/25284/4e42404572bfae878897/

source:python black hole net

Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.

8 0
collect article
collected

Comment content: (supports up to 255 characters)