ImportError: cannot import name 'webdriver'

If your file name is selenium.py, change it to something else and delete .pyc files or the __pycache__ directory if exists.

If you do not have the selenium, you should install the selenium by using pip or pipenv:

pip install selenium

It says that webdriver cant be import.So I assume you have Selenium installed.

So I can only assume that the selenium lied in different place in your path.

Maybe you have accidently create a file named selenium ?


  1. if your file is selenium.py rename it.
  2. Pay attention to have import Keys instead of import keys

Step 1: First rename filename if saved with selenium.py and delete selenium.pyc. mv selenium.py test.py rm selenium.pyc Step 2: import module selenium if not already installed. pip install selenium