如何在Mac上安装selenium python

时间:2017-09-01 10:19:01

标签: python selenium terminal macos-sierra

我已经下载了python的Selenium zip文件,它包含了setup.py的文件夹。它在python.org上说我必须输入终端'python setup.py install',但是它给了我这个错误,我需要成为管理员,因为我没有该目录的权限,实际上我的用户已经是管理员了:

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

1 个答案:

答案 0 :(得分:0)

我不想触摸Mac的默认python。相反,我建议酿造你自己的蟒蛇

https://brew.sh/

安装brew

然后安装python

brew install python3

然后安装selenium

pip3 install selenium