Reputation: 39
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:
Launched python3.7 (64-bit) console and running import
again (from selenium import webdriver"
and it works.
Launched Anaconda Prompt (Anaconda3) and ran the command conda install -c clinicalgraphics selenium
, but it shows this error:
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
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
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