Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's causing this error when I try and install virtualenv? IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv.py'

I'm trying to install a virtual environment using the command:

pip install virtualenv

but I get the following error:

IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv.py'

How do I fix this?

like image 875
Takeshi Patterson Avatar asked Jul 01 '14 07:07

Takeshi Patterson


People also ask

How do I fix permission is denied in Python?

Permission denied simply means the system is not having permission to write the file to that folder. Give permissions to the folder using "sudo chmod 777 " from terminal and try to run it.

Could not open requirements file errno 13 Permission denied?

The PermissionError: [errno 13] permission denied error occurs when you try to access a file from Python without having the necessary permissions. To fix this error, use the chmod or chown command to change the permissions of the file so that the right user and/or group can access the file.

Could not install packages due to an Oserror errno 13 Permission denied '/ nonexistent?

The error "Could not install packages due to an EnvironmentError: [Errno 13] Permission denied" is often caused because the user doesn't have access to modify the directory where the package should be installed. To solve the error, allow the user full access to the Python directory.


3 Answers

At a glance it looks like you need admin permissions to install packages on your system. Try starting pip as admin or your OS equivalent.

like image 52
idiot.py Avatar answered Oct 08 '22 10:10

idiot.py


Your account does not have write access to this directory?.

  1. If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account.

    sudo pip install virtualenv
    
  2. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHON_PATH environment variable.

  3. easier way: change that dir permission:

    chmod +a 'user:YOUR_USER_NAME allow add_subdirectory,add_file,delete_child,directory_inherit' /Library/Python/2.7/site-packages
    
like image 27
Luckie Hao Avatar answered Oct 08 '22 12:10

Luckie Hao


You don't have permission to edit the system-wide version of this library. Try using sudo:

sudo pip install --upgrade virtualenv
like image 27
TeeTracker Avatar answered Oct 08 '22 12:10

TeeTracker