0

Need help.... I tried tons of times to use admin account to install beautifulsoup4-4.0.0b3, but had aten tons of failure. I use Macpro OS X Lion 10.7.2

What happened in the terminal as below:

WHEN I TEPYED: easy_install beautifulsoup4

RESPONDED:

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/Python/2.7/site-packages/ 
test-easy-install-411.write-test' 
The installation directory you specified (via --install-dir, --prefix, 
or the distutils default setting) was: 
    /Library/Python/2.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://peak.telecommunity.com/EasyInstall.html 
Please make the appropriate changes for your system and try again. 

AND ITS AUTOMATICALLY REPEATED THIS DIALOGUE AGIAN:

$ easy_install cd beautifulsoup4-4.0.0b3 
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/Python/2.7/site-packages/ 
test-easy-install-415.write-test' 
The installation directory you specified (via --install-dir, --prefix, 
or the distutils default setting) was: 
    /Library/Python/2.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://peak.telecommunity.com/EasyInstall.html 
Please make the appropriate changes for your system and try again. `

It almost drive me crazy. Thanks for anyone helping me figure out what the problem is...

juliomalegria
  • 24,229
  • 14
  • 73
  • 89
user1364795
  • 1
  • 1
  • 1

2 Answers2

2

Easy: Try sudo easy_install beautifulsoup4 and then type in your admin password.

Harder: I would recommend setting up a virtualenv. Once you set it up, you can install stuff without an admin password. It's also advantageous because if you screw up the Python install, you can just delete the virtualenv and start over again. (You do need to have XCode installed to set up a virtualenv, so it can be a bit of a hassel)

Theron Luhn
  • 3,974
  • 4
  • 37
  • 49
1

The error permission denied shows you that you do have the write privilege, so you need to use sudo in front of your command.

Use sudo easy_install beautifulsoup4 or better yet, pip install beautifulsoup4 with virtualenv without having to use sudo.

K Z
  • 29,661
  • 8
  • 73
  • 78