gpt4 book ai didi

python - 导入错误 : No module named 'selenium' in PyCharm

转载 作者:行者123 更新时间:2023-11-28 20:00:46 30 4
gpt4 key购买 nike

我已经安装了所有文件和包,如 python、pip、selenium,并且我在 PyCharm 中运行 python 代码,但每当我运行我的代码时它仍然向我显示此错误。

运行 python 文件时显示错误。

Traceback (most recent call last): File "C:/Users/aman.k/PycharmProjects/SeleniumScripts/MyFirstSeleniumScript.py", line 3, in import webdriver ModuleNotFoundError: No module named 'webdriver'

代码运行环境:

  • Windows 操作系统 8.1
  • python 3.7.2
  • 点子 19.0.2

这是我尝试运行的代码。

enter image description here

最佳答案

从您的屏幕截图中,我可以看到未安装 selenium。请按照下一步操作:

第一种解决方案:

File -> Settings -> Inside your project's name -> Project Interpreter -> click on "+" button -> search for selenium (current version 3.141.0) -> click on install -> restart PyCharm.

第二种解决方案:

Or click on the selenium word from the first line (from the import) and wait until a solution will be shown. The solution will say install selenium package. Press on it and you are done.

解决方案 2 的屏幕截图:

enter image description here

第三个解决方案:

If you have already installed the selenium then you need to install webdirver. Follow the following screenshot to solve it.

第三个解决方案的屏幕截图:

enter image description here

关于python - 导入错误 : No module named 'selenium' in PyCharm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54760754/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com