Baktaawar
Baktaawar

Reputation: 7500

Giving write permission to a user on linux server to create Anaconda env

I have both a root access and my own account on the server. Now I have anaconda installed as root and under /opt/anaconda3.

I have access to anaconda as a user on that same server. But when I try to create an environment in conda it always gives me this error.

NotWritableError: The current user does not have write permissions to a required path.
  path: /opt/.conda/environments.txt
  uid: 1002
  gid: 1002

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

  $ sudo chown 1002:1002 /opt/.conda/environments.txt

When I run

sudo chown 1002:1002 /opt/.conda/environments.txt

It does allow me to create an env then with no issues. But it only works for that session. Next time login again same issue.

So I think I need to add write permission to my user id to this file.

How do I do that?

Should I login as root by doing

sudo su -

And then do

chmod u+rw 

But how do I specify uid and gid as mentioned above to get the write access to this file.

Thanks

Upvotes: 0

Views: 1846

Answers (1)

Ajay Mohan
Ajay Mohan

Reputation: 23

Try doing the below steps,

sudo chown 1002:1002 /opt/.conda/environments.txt

sudo chmod u+w /opt/.conda/environments.txt

sudo chmod g+w /opt/.conda/environments.txt

Upvotes: 1

Related Questions