2012-04-29 1 views
0

Нужна помощь .... Я пробовал много раз, чтобы использовать учетную запись администратора, чтобы установить beautifulsoup4-4.0.0b3, но имел aten тонны отказа. Я использую MacPro OS X Lion 10.7.2Установка Beautifulsoup с учетной записью администратора Mac OSX

То, что произошло в терминале, как показано ниже:

КОГДА Я TEPYED: easy_install beautifulsoup4

ответил:

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. 

И ЕГО АВТОМАТИЧЕСКИ ПОВТОРНЫЙ ДИАЛОГ АГИАН:

$ 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. ` 

Это почти сводит меня с ума. Спасибо за тех, кто помогает мне понять, что проблема ...

ответ

1

Ошибка permission denied показывает, что у вас есть привилегия записи, так что вам нужно использовать sudo перед вашей командой.

Используйте sudo easy_install beautifulsoup4 или еще лучше, pip install beautifulsoup4 с virtualenv без использования sudo.

2

Простой: попробуйте sudo easy_install beautifulsoup4, а затем введите свой пароль администратора.

Harder: Я бы порекомендовал установить virtualenv. После его установки вы можете установить материал без пароля администратора. Это также выгодно, потому что, если вы испортите установку Python, вы можете просто удалить virtualenv и начать заново. (Вам необходимо установить XCode для настройки виртуального, так что это может быть немного hassel)