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:
- python - 3.11.7
- pip - 24.0
- pipenv - 2023.12.0
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.
Based on the comments by Philippe and chepner, I decided to change the ownership of my
~/.local/folder. For surety's sake, I used theidcommand to check my username and group. On MacOS, I guess the group is alwaysstaff. Then I just used the command:sudo chown -R joshuasullivan:staff ~/.localAnd everything started working properly.