当前位置:网站首页>NotWritableError: The current user does not have write permissions when conda creates a new environment

NotWritableError: The current user does not have write permissions when conda creates a new environment

2022-08-10 00:55:00 passion-ma

In use

conda create -n environment_name

When the command to create a new environment, an error was encountered:

Solving environment: failed
NotWritableError: The curren user does not have write permissions to a required path.
path: /home/user_name/.conda/pkgs/urls.txt
uid: 1021
gid: 1021

If you feel that permissions on this path are set incorrectly, you can manually
change them by executing

$ sudo chown 1021:1021 /home/user_name/.conda/pkgs/urls.txt

In general, it's not advisable to use 'sudo conda'.

2. Reason for the problem

Perhaps the redundant problem caused by sudo sh Ana... when installing Anaconda.

Anaconda was installed with root permissions, so now non-root users do not have read and write permissions to the anaconda3 folder.

3. Solution

Option 1:

'cd' to the location of the 'annoconda3' folder and run the following command:

sudo chown -R username anaconda3 #username is your own username

Option 2:

Following the prompts he gave to no avail, so use the following command to change the permissions of conda-related folders, -r recursively apply to subfolders

sudo chmod 777 -R ~/anaconda3/
sudo chmod 777 -R ~/.conda/

4. Test

Using the scheme is invalid for my problem, but some netizens say it is feasible.

The second solution successfully solved my problem, and you can create a new environment.

Solving environment: done

原网站

版权声明
本文为[passion-ma]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/222/202208092244251517.html