Python “如何修复”;ModuleNotFoundError:没有名为';selenium.webdriver.comma'&引用;?

Python “如何修复”;ModuleNotFoundError:没有名为';selenium.webdriver.comma'&引用;?,python,python-3.x,selenium,pip,Python,Python 3.x,Selenium,Pip,我第一次尝试将selenium导入到我的新Python项目中。但当我运行程序时,它不工作,并显示以下消息 我检查了python和selenium是否安装正确。我甚至试图重新安装它,但仍然显示相同的消息。我可能在某个地方犯了一个愚蠢的错误,因为我刚刚开始使用Python和Selenium。有人有解决办法吗 我的代码: from selenium import webdriver from selenium.webdriver.comma.keys import Keys driver = web

我第一次尝试将selenium导入到我的新Python项目中。但当我运行程序时,它不工作,并显示以下消息

我检查了python和selenium是否安装正确。我甚至试图重新安装它,但仍然显示相同的消息。我可能在某个地方犯了一个愚蠢的错误,因为我刚刚开始使用Python和Selenium。有人有解决办法吗

我的代码:

from selenium import webdriver
from selenium.webdriver.comma.keys import Keys

driver = webdriver.Firefox()
driver.get("http://www.python.org")
这是输出:

Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
RESTART: C:\Users\Henryk\Documents\Selenium sample 
project\SeleniumSampleProject.py 
Traceback (most recent call last):
File "C:\Users\Henryk\Documents\Selenium sample 
project\SeleniumSampleProject.py", line 2, in <module>
from selenium.webdriver.comma.keys import Keys
ModuleNotFoundError: No module named 'selenium.webdriver.comma'
>>>
Python 3.7.3(v3.7.3:ef4ec6ed12,2019年3月25日,21:26:53)[MSC v.1916 32位
(英特尔)]在win32上
有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证()。
>>> 
重新启动:C:\Users\Henryk\Documents\Selenium示例
project\SeleniumSampleProject.py
回溯(最近一次呼叫最后一次):
文件“C:\Users\Henryk\Documents\Selenium sample
project\SeleniumSampleProject.py“,第2行,在
从selenium.webdriver.comma.keys导入密钥
ModuleNotFoundError:没有名为“selenium.webdriver.comma”的模块
>>>
尝试使用通用:

from selenium.webdriver.common.keys import Keys

python-mpip安装-Uselenium@Jakub没有名为
selenium.webdriver.comma的模块,但您正在尝试从中导入。解决你的问题这应该能解决问题