当我已经安装了模块时,没有名为selenium的模块

时间:2017-10-06 20:25:50

标签: python selenium

我已经尝试了几个小时来安装硒,现在我有了,我得到了错误

Traceback (most recent call last):
  File "C:/Users/Family/Documents/open python.py", line 1, in <module>
    from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'

这是我的代码:

from selenium import webdriver

from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()

driver.get('https://www.python.org')

即使我继续使用cmd并尝试安装它,它仍然表示该软件包已经安装在python34-Lib-sitepackages中:

  

env:C:\ ProgramData \ Oracle \ Java \ javapath; C:\ Program Files   (x86)\ Intel \ iCLS Client \; C:\ Program Files \ Intel \ iCLS   客户端\; C:\ WINDOWS \ SYSTEM32; C:\ WINDOWS; C:\ WINDOWS \ SYSTEM32 \ WBEM; C:\ WINDOWS \ SYSTEM32 \ WindowsPowerShell \ V1.0 \; C:\ PROGRAM   Files \ Intel \ Intel(R)管理引擎组件\ DAL; C:\ Program   Files \ Intel \ Intel(R)Management Engine Components \ IPT; C:\ Program Files   (x86)\ Intel \ Intel(R)管理引擎组件\ DAL; C:\ Program Files   (x86)\ Intel \ Intel(R)管理引擎组件\ IPT; C:\ Users \ kaleem   Hussain \ AppData \ Local \ Smartbar \ Application \; C:\ Program Files   (86)\的Skype \电话\; C:\ Python34; C:\ Python34 \脚本

1 个答案:

答案 0 :(得分:0)

尝试使用pip安装selenium并检查它是否已解决:

python -m pip install -U selenium