user8483278
user8483278

Reputation:

When conda install django, PermissionError(13, 'Permission denied')

When I run conda install django, I get the following error:

Solving environment: done

==> WARNING: A newer version of conda exists. <==

current version: 4.4.10

latest version: 4.4.11

Please update conda by running

$ conda update -n base conda

## Package Plan ##

environment location: /opt/anaconda/anaconda3

added / updated specs: - django

The following NEW packages will be INSTALLED:

django: 2.0.2-py36hd476221_0

Proceed ([y]/n)? y

Preparing transaction: done

Verifying transaction: done

Executing transaction: failed

ERROR conda.core.link:_execute(481): An error occurred while installing package 'defaults::django-2.0.2-py36hd476221_0'. PermissionError(13, 'Permission denied') Attempting to roll back.

Rolling back transaction: done

PermissionError(13, 'Permission denied')

What should I do?

Upvotes: 8

Views: 23535

Answers (5)

Robocco
Robocco

Reputation: 131

I solved with:

sudo chown -R user anaconda3

where user is your username and anaconda3 is the path to your anaconda installation, which can be found by running conda info.

I used this issue as reference.

Upvotes: 11

Rizwan
Rizwan

Reputation: 11

This solved my problem. For Windows: Try deleting the pip folders in AppData/Temp. Python is unable to delete these folders and create new pip folders for unpacking the new installations.

Upvotes: 1

user2034200
user2034200

Reputation: 49

I would like to add that the same goes for windows command prompt. You must run the Anaconda prompt as Admin.

Upvotes: 4

user8483278
user8483278

Reputation:

I fixed.

I changed the permission of /opt/anaconda/anaconda3 recursively.

Upvotes: 1

Daniel Kilanko
Daniel Kilanko

Reputation: 110

Permission Denied.. That's likely because you are not running your command as root. Try and run your command as superAdmin

Upvotes: 1

Related Questions