Joshua Sullivan
Joshua Sullivan

Reputation: 1139

pipenv: Permission denied for ~/.local/share/virtualenvs

I'm working with a codebase that uses pipenv to install dependencies as part of its setup. However, I'm getting the following error when the pipenv install --deploy --dev command is run:

PermissionError: [Errno 13] Permission denied: '/Users/XXX/.local/share/virtualenvs'

I've checked the .local/share folder and it does not contain a virtualenvs folder. Also, the entire .local folder is owned by root.

Tool versions:

I tried sudo creating a 'virtualenvs' folder in there, but it didn't help... still permission denied. Very reluctant to chown a directory that I don't understand the security scope of.

Upvotes: 0

Views: 135

Answers (2)

Johnny Senator
Johnny Senator

Reputation: 1

A generalized version of OP's answer:

sudo chown -R $(id -u):$(id -g) $HOME/.local

Upvotes: 0

Joshua Sullivan
Joshua Sullivan

Reputation: 1139

Based on the comments by Philippe and chepner, I decided to change the ownership of my ~/.local/ folder. For surety's sake, I used the id command to check my username and group. On MacOS, I guess the group is always staff. Then I just used the command:

sudo chown -R joshuasullivan:staff ~/.local

And everything started working properly.

Upvotes: 1

Related Questions