0

Cannot install BeautifulSoup on my computer and it continues to tell me that I don't have writable access? See below:

Last login: Fri Jun 26 14:08:26 on ttys000
Britneys-MacBook-Air:~ Pryde$ pip install requests
-bash: pip: command not found
Britneys-MacBook-Air:~ Pryde$ easy_install requests
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-19650.pth'

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.

Any feedback would be greatly appreciated. -Thanks!

1 Answers1

1

When using pip install on a Mac, you need to run that command as sudo (a temporary admin escalation if you want a really bad explanation of what sudo does - it will prompt you for your password).

sudo pip install requests

That will solve your writeable access. However as another poster mentioned, you are dealing with requests, not BeautifulSoup. Same applies re sudo.

pip list and other non-install/modifying pip subcommands can run just fine without sudo.

update: you don't seem to have pip installed yet. My bad, I didn't catch that because you pasted in the pip install, got an error, but then tried easy install and the bulk of the message concerns easy install.

This link explains how to install pip. install pip on mac. Notice the sudo again. Once that has worked, you can re-try your first sudo pip install requests.

You probably want to do that, because pip seems generally more clever than just easy install by itself.

Community
  • 1
  • 1
JL Peyret
  • 10,917
  • 2
  • 54
  • 73