7

I am running Enthought python on a Mac in 32 bit mode

my PATH variable is set as PATH=/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

when attempting to install or easy_install I get "cant create or remove files in the install directory"

here is the trace (ls -l of the directory follows as well)

Johns-MacBook-Pro:bin jc_macpro$ easy_install pip
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the installation directory:

[Errno 13] Permission denied: '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/test-easy-install-516.write-test'

The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:

/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/

Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. 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 PYTHONPATH environment variable.

For information on other options, you may wish to consult the documentation at:

http://packages.python.org/distribute/easy_install.html

Please make the appropriate changes for your system and try again.

=========================== when i look at site-packages, it has the following access privileges. I am the administrator account.

drwxrwxr-x   107 root  wheel    3638 Oct 21 09:55 site-packages
1

3 Answers 3

16

You’ll need to run sudo easy_install otherwise you won’t have permission to write to the install dirs.

2
  • Thank you. Is there a reason why I required sudo even though I am the administrator? i.e. did I screw something up! Dec 20, 2012 at 13:48
  • Your user perhaps belongs to the administrator group but that only means that you’ll be able to write files to folders that have group write permission and group owned by administrator. sudo essentially temporarily elevates your privileges to root — root can write files to anywhere.
    – paulgrav
    Dec 20, 2012 at 13:55
5

Have you tried sudo for the installation? It should give you the rights to 'create or remove' files.

1
  • Thank you. Sorry I could only apply one answer as "the Answer" Yours was just as clear but I few seconds behind. Thanks again Dec 20, 2012 at 13:49
-3

Use "sudo" whenever Permission Denied

1
  • 2
    Welcome to SO. It's worth having a look at the existing answers before posting your own as this solution has been posted twice already.
    – Nick
    Apr 15, 2021 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.