简体   繁体   中英

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?

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.

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 

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

sudo pip install --upgrade virtualenv

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM