【问题标题】:from selenium import webdriver ModuleNotFoundError: No module named 'selenium' (PyCharm)从 selenium 导入 webdriver ModuleNotFoundError:没有名为“selenium”的模块(PyCharm)
【发布时间】:2017-10-15 19:12:33
【问题描述】:

在使用 Selenium WebDriver 运行我的脚本时,我在 PyCharm 中遇到了问题:

/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /Users/ratmir/PycharmProjects/TestAutomationGF/Test/firsttest.py
Traceback (most recent call last):
  File "/Users/ratmir/PycharmProjects/TestAutomationGF/Test/firsttest.py", line 1, in <module>
    from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'

我检查了 selenium 是否已安装:

python -m pip install -U selenium
Requirement already up-to-date: selenium in /Library/Python/2.7/site-packages

我看到在 PyCharm 中我有另一个版本的 Python……你能帮我解决这个问题吗?谢谢。

【问题讨论】:

    标签: python selenium pycharm


    【解决方案1】:

    使用:python -m pip install selenium 在 Python27 文件夹或 Python34 文件夹中,无论您使用哪个(最好是 3.4),然后通过在设置中选择相应的解释器尝试在 PyCharm 中进行安装,或者使用 PyCharm 进行安装。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-22
      • 1970-01-01
      • 2020-08-08
      • 2021-03-22
      • 2019-03-18
      • 2020-11-20
      • 1970-01-01
      • 2021-05-16
      相关资源
      最近更新 更多