【发布时间】:2020-03-28 16:51:37
【问题描述】:
我在我的系统中安装了两个版本的 python,例如 python 3.6 和 python 3。 我正在 PyCharm 中运行一个程序,该程序运行良好,而同一脚本未在 Jupyter Notebook 中运行。显示的错误:
ModuleNotFoundError: 没有名为“selenium”的模块
我使用 anaconda 安装了 jupyter。 以下是我的问题:
- 如何为同一个脚本运行 jupyter notebook?
- 我的笔记本没有指向我在 PyCharm 中运行的同一 python 版本吗? 如果是这样,如何将其更改为适当的 python 版本?
from selenium import webdriver
driver = webdriver.Chrome(r'C:\Users\Admin\Desktop\sriyam\chromedriver.exe')
driver.get('https://python.org')
【问题讨论】:
-
你是如何安装 selenium 的?如果在 PyCharm 中发生此错误,请转到设置 > 项目解释器,然后选择安装了 selenium 的解释器。