0

I've downloaded the Selenium zip file for python and it contains the folder with the setup.py. It says on python.org that I have to type in terminal 'python setup.py install' but it gives me this error that I need to be administrator because I have no permission to the directory, when in fact my user is already an administrator:

Checking .pth file support in /Library/Python/2.7/site-packages/
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-1469.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.

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

  https://pythonhosted.org/setuptools/easy_install.html

Please make the appropriate changes for your system and try again.`
3
  • Please try sudo command in the terminal Commented Sep 1, 2017 at 10:21
  • @Eugene this is what I get: usage: sudo -h | -K | -k | -V usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user] usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command] usage: sudo [-AbEHknPS] [-C num] [-g group] [-h host] [-p prompt] [-u user] [VAR=value] [-i|-s] [<command>] usage: sudo -e [-AknS] [-C num] [-g group] [-h host] [-p prompt] [-u user] file Commented Sep 1, 2017 at 10:33
  • try this can help stackoverflow.com/questions/18868743/… Commented Sep 1, 2017 at 10:50

1 Answer 1

1

I prefer not to touch Mac's default python. Instead I would suggest to brew your own python

Install brew from https://brew.sh/

then install python

brew install python3

Then install selenium

pip3 install selenium
Sign up to request clarification or add additional context in comments.

6 Comments

so I have to paste this /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" into Terminal right? But now Terminal isn't returning me with any messages, should I wait longer?
There would be another popup to install xcode components and you need to say yes to them
But I'm not getting any popups or anything
You know when you use Terminal the line starts with "computer-name:~ user-name$"? When I enter the script from homebrew website to install it, it returns a new empty line instead and nothing else.
It should show something like this i.sstatic.net/TVyeO.png and use three fingers up on mousepad to check if you are missing some other window which is asking to install xcode tools
|

Your Answer

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