0

I am using Selenium version 3.8 with Python3.6 with chromedriver/gekodriver.

whenever I am running :

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

I am getting following error message:

C:\Users\myname\PycharmProjects\Selenium\venv\Scripts\python.exe C:/Users/myname/.PyCharmCE2017.3/config/scratches/scratch_19.py  
Traceback (most recent call last):
  File "C:/Users/myname/.PyCharmCE2017.3/config/scratches/scratch_19.py", line 2, in <module>  
    from selenium.webdriver.common.keys import Keys  
ModuleNotFoundError: No module named 'selenium.webdriver.common'  
Process finished with exit code 1

but this is not happening every time few scripts are running perfectly fine:

Following are the steps I have followed:

  1. Tried uninstalling and reinstalling Selenium using pip.
  2. I am facing this issue intermittently both in python IDE and PyCharm.

Further more I have not setup environment variable for Selenium, is this a necessary step for importing selenium module?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

0

I was getting this error message as I have created a file using the same name "selenium". when I removed that file it fixed the issue.