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.`
  • Please try sudo command in the terminal – Eugene Sep 01 '17 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] [] usage: sudo -e [-AknS] [-C num] [-g group] [-h host] [-p prompt] [-u user] file` –  Sep 01 '17 at 10:33
  • try this can help https://stackoverflow.com/questions/18868743/how-to-install-selenium-webdriver-on-mac-os – Kallz Sep 01 '17 at 10:50

1 Answers1

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
Tarun Lalwani
  • 142,312
  • 9
  • 204
  • 265
  • 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? –  Sep 01 '17 at 10:50
  • There would be another popup to install xcode components and you need to say yes to them – Tarun Lalwani Sep 01 '17 at 13:01
  • But I'm not getting any popups or anything –  Sep 01 '17 at 14:31
  • 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. –  Sep 01 '17 at 14:33
  • It should show something like this https://i.stack.imgur.com/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 – Tarun Lalwani Sep 01 '17 at 15:04
  • Aah it works now, I was trying the script at school and they have a barracuda filter maybe that's why. Now I've tried it at home and it works thanks. –  Sep 01 '17 at 15:28