Python selenium库在Windows上无法安装
我在Windows 7电脑上尝试安装Selenium的Python库:
结果出现了这个:
------------------------------------------------------------
C:\Python27\Scripts\pip-script.py run on 03/31/11 11:44:21
Downloading/unpacking selenium
Exception:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip-0.8.3-py2.7.egg\pip\basecommand.py", line 127, in main
self.run(options, args)
File "C:\Python27\lib\site-packages\pip-0.8.3-py2.7.egg\pip\commands\install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python27\lib\site-packages\pip-0.8.3-py2.7.egg\pip\req.py", line 936, in prepare_files
location = req_to_install.build_location(self.build_dir, not self.is_download)
File "C:\Python27\lib\site-packages\pip-0.8.3-py2.7.egg\pip\req.py", line 147, in build_location
_make_build_dir(build_dir)
File "C:\Python27\lib\site-packages\pip-0.8.3-py2.7.egg\pip\req.py", line 1177, in _make_build_dir
os.makedirs(build_dir)
File "C:\Python27\lib\os.py", line 157, in makedirs
mkdir(name, mode)
WindowsError: [Error 5] Access is denied: 'C:\\Windows\\System32\\build'
2 个回答
1
4
WindowsError: [Error 5] Access is denied: 'C:\\Windows\\System32\\build'
这段话的意思是,你没有权限访问 C:\Windows\System32\
这个文件夹。通常这是因为你不是管理员。
你可以试着用管理员账户来运行 pip
:
- 按下Windows徽标键(这个东西的技术名称就是它)。
- 输入“cmd”。
- 右键点击“cmd.exe”,然后选择“以管理员身份运行”。
- 稍等一下,可能会出现用户账户控制(UAC)的提示。
- 现在再试着运行
pip
。