由于错误,Selenium无法安装

时间:2015-11-04 02:40:38

标签: selenium command-line terminal install

我正在尝试安装Selenium并且遇到了这些错误。我看了一些关于Git hub的修复但没有任何帮助。有没有人认识到这个问题并且知道如何修复它?

Jasons-MBP:~ jasonmcgriff$ pip install selenium
Collecting selenium
Downloading selenium-2.48.0-py2-none-any.whl (872kB)
100% |████████████████████████████████| 872kB 421kB/s 
Installing collected packages: selenium
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/commands/install.py", line 311, in run
root=options.root_path,
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_set.py", line 646, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_install.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_install.py", line 998, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/wheel.py", line 339, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/wheel.py", line 310, in clobber
ensure_dir(destdir)
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/utils/__init__.py", line 71, in ensure_dir
os.makedirs(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os. py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-   packages/selenium'enter code here

1 个答案:

答案 0 :(得分:0)

如果您查看上次发布的错误...

OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site- packages/selenium'

/selenium*

下已有内容

我对这条路有同样的问题......

OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/selenium-2.42.1-py2.7.egg-info'

简单地删除就像......

sudo rm -r /Library/Python/2.7/site-packages/selenium-2.42.1-py2.7.egg-info

然后重新安装它工作并更新到最新。我用过这个......

pip install --upgrade selenium

注意我没有使用sudo或尝试以root身份运行。