No module named 'selenium.common'

Viewed 203

I am trying to run this code on a Windows 64-bit system.

from selenium.common.exceptions import NoSuchElementException, ElementClickInterceptedException
from selenium import webdriver

The error I get is: No module named 'selenium.common'

I have already installed selenium in the same directory as Python using

pip install selenium

After installing:

C:\Users\user\AppData\Local\Programs\Python\Python38>pip install selenium
Requirement already satisfied: selenium in c:\users\user\appdata\local\programs\python\python38\lib\site-packages (3.141.0)
Requirement already satisfied: urllib3 in c:\users\user\appdata\local\programs\python\python38\lib\site-packages (from selenium) (1.25.9)

I checked the versions as well

C:\Users\user>pip -V
pip 21.1.1 from c:\users\user\appdata\local\programs\python\python38\lib\site-packages\pip (python 3.8)

C:\Users\user>python -V
Python 3.8.2

I tried running this using Spyder as well as Atom but I'm getting the same error.

1 Answers

try this command -

pip3 install selenium

or

python -m pip install -U selenium
Related