user125104
user125104

Reputation: 39

python cannot import selenium in jupyter

I had download selenium and ran both pip install selenium and pip3 install selenium successfully. But in jupyter when I import selenium (from selenium import webdriver), it prompts: ModuleNotFoundError: No module named 'selenium'.

I have:

UnavailableInvalidChannel: The channel is not accessible or is invalid.
  channel name: clinicalgraphics
  channel url: https://conda.anaconda.org/clinicalgraphics
  error code: 404

Anyone else facing the same issue when using juypter?

Upvotes: 0

Views: 9027

Answers (2)

Tooblippe
Tooblippe

Reputation: 3701

Can you check if the python3.7 console is in the same environment as anaconda. It could be that your pip install did in fact install the selenium package in your system Python and not the Anaconda environment. It is therefore not available in the Jupyter notebook.

What you could do is to open the Anaconda Notebook and then issue the command in a cell

!conda install selenium

or

!pip install selenium

then go the the menu and restart the kernel. See if you can import it now?

Upvotes: 0

Devansh Soni
Devansh Soni

Reputation: 771

Try running this command in your jupyter notebook:

! pip3 install selenium or ! pip install selenium (depending on your Python version)

This will install selenium directly from the notebook. Please comment if the issue persists.

Upvotes: 2

Related Questions