CondaError: No writable package cache directories found in conda-pkgs

Question:

When I try to create a virtual environment for my jupyter notebook or install any packages in it or try to update conda.

conda create -n virenv python=3.6

I get an error

CondaError: No writable package cache directories found in
('C:\ProgramData\conda-pkgs',)

How do I resolve this?

Asked By: Himanshuman

||

Answers:

That was due to some permission error I guess. So I created a dedicated folder in my user directory as a package cache, then added it to the pkgs_dirs configuration option (conda config –add pkgs_dirs dir_name). We may need to manually add the default cache(s) back since I think customizing excludes them (check conda config –show pkgs_dirs before and after).

Answered By: Himanshuman

That might happen if you write no at the end of the anaconda installation,
resulting in permission issues and conda enviroment not being activated.
as well as you can’t create more enviroments.

Solution is :

sudo chmod a+w /home/path/to/.conda

example

sudo chmod a+w /home/yourusername/.conda

Cheers.

Answered By: Karim Sherif