简体   繁体   English

如何为 Jupyter Notebook 安装 selenium?

[英]How to install selenium for Jupyter Notebook?

I have run the command pip install selenium , and it can execute from selenium import webdriver in terminal, but it cannot execute this line in Jupyter Notebook, which shows "ModuleNotFoundError: No module named 'selenium'" .我已经运行了命令pip install selenium ,它可以在终端中from selenium import webdriver执行,但它不能在 Jupyter Notebook 中执行这一行,它显示"ModuleNotFoundError: No module named 'selenium'" Besides, I also copied chromedriver.exec file into the path of my jupyter.此外,我还将chromedriver.exec文件复制到我的 jupyter 路径中。 Does anyone konw how to solve it?有谁知道如何解决它?

在此处输入图片说明 在此处输入图片说明

If you are using the Anaconda navigator to run Jupyter then you need to run the pip install selenium command within the Anaconda prompt.如果您使用 Anaconda 导航器运行 Jupyter,则需要在 Anaconda 提示符下运行pip install selenium命令。

I believe that your Python environment in Jupyter differs from the Python environment that may be in your PATH.我相信您在 Jupyter 中的 Python 环境与可能在您的 PATH 中的 Python 环境不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM