Importing webdriver from selenium cannot find reference

Hi there!

I've installed selenium from pip and it seems to be worked fine. When I write 'from selenium import webdriver', the last is shown and I can found out the folder under Python36>selenium>webdriver. But the problem is PyCharm say "Cannot find reference 'webdriver' in 'imported module selenium'" and can't see why...

Any idea?

Thanks!!

2 comments
Comment actions Permalink

1. Please check the project interpreter configured. See below example to locate it on Pycharm

2. If 1 does not work, pip uninstall selenium and pip install -U selenium ( I observed it with some users that though they installed selenium not all required files are installed, I would recommend you to uninstall and install selenium)

3.if both do not work for you, read below links from stackoverflow to try some more options:

https://stackoverflow.com/questions/7426851/trying-to-use-selenium-2-with-python-bindings-but-im-getting-an-import-error/51345868#51345868 

https://stackoverflow.com/questions/49482586/pycharm-referenced-error-with-import-selenium-webdriver 

https://stackoverflow.com/questions/45645838/python-having-errors-with-selenium-webdriver?rq=1 

0
Comment actions Permalink

Just name your pytnon file NOT selenium.py !!!
It is not looking for webdriver in selenium, but in your file, where you are trying to connect it

0

Please sign in to leave a comment.