概述
使用Python2.5
操作系统Windows Vista
当我尝试使用pip install -U SeleniumC:UsersUser>pip install -U Selenium
Downloading/unpacking Selenium
Downloading selenium-2.13.1.tar.gz (3.3Mb): 3.3Mb downloaded
Running setup.py egg_info for package Selenium
warning: no files found matching 'docsapipyindex.rst'
c:Python25libdistutilsdist.py:263: UserWarning: Unknown distribution option: 'src_root'
warnings.warn(msg)
Downloading/unpacking rdflib==3.1.0 (from Selenium)
Downloading rdflib-3.1.0.tar.gz (249Kb): 249Kb downloaded
Running setup.py egg_info for package rdflib
Installing collected packages: Selenium, rdflib
Found existing installation: selenium 2.13.1
Uninstalling selenium:
Successfully uninstalled selenium
Running setup.py install for Selenium
warning: no files found matching 'docsapipyindex.rst'
c:Python25libdistutilsdist.py:263: UserWarning: Unknown distribution option: 'src_root'
warnings.warn(msg)
c:Python25Libsite-packagesseleniumwebdriverremotewebdriver.py:668: Warning: 'with' will become a reserved keyword in Python 2.6
File "c:Python25Libsite-packagesseleniumwebdriverremotewebdriver.py", line 668 with open(filename, 'wb') as f:
^
SyntaxError: invalid syntax
Found existing installation: rdflib 3.1.0
Uninstalling rdflib:
Successfully uninstalled rdflib
Running setup.py install for rdflib
Successfully installed Selenium rdflib
Cleaning up...
所以手动下载了Selenium 2.13包,并将Selenium.py文件复制到c://python25/lib/。但是,当我尝试从python中导入webdriver时,它会给出以下错误:C:UsersUser>python F:Seleniumlocaltest2.py
Traceback (most recent call last):
File "F:Seleniumlocaltest2.py", line 1, in
from selenium import webdriver
ImportError: cannot import name webdriver
selenium安装是否有问题,或者我正在做什么错误的事情?也许仅仅复制selenium.py文件是愚蠢的?菜鸟,容忍我。遵循给定的教程appendix_installing_python_driver_client.html" rel="nofollow">here。
在上面的教程中,我不知道如何做到这一点:“将文件selenium.py添加到测试路径”
最后
以上就是爱听歌大炮为你收集整理的python无法安装selenium_Python和Selenium-安装不起作用的全部内容,希望文章能够帮你解决python无法安装selenium_Python和Selenium-安装不起作用所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复