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:
- Tried uninstalling and reinstalling Selenium using
pip
. - 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?