Pycharm Referenced Error With Import Selenium Webdriver

Question:

Am using Python 3.6.5rcs , pip version 9.0.1 , selenium 3.11.0. The Python is installed in C:Python and selenium is in C:PythonLibsite-packagesselenium. The environment variables have been set.
But the code
from selenium import webdriver
gives an unresolved reference error.
Any suggestion on how to fix the problem.

Asked By: faisal abdulai

||

Answers:

Pycharm > Preferences > Project Interpreter

Then hit the ‘+’ to install the package to your project path.

Or you can add that path to your PYTHONPATH environment variable in your project.

Answered By: John R

I found this worked for me. I’m using PyCharm Community 2018.1.4 on Windows.

Navigate to: File->Settings->Project: [project name] -> Project Interpreter

On this page click the configuration wheel at the top which should provide a drop down menu. Click “Add” and a window should appear called “Add Python Interpreter”

You will be defaulted onto “Virtualenv Environment” tab.

There should be a checkbox called “Inherit global site-packages”. Check this.

Click OK.

All your installed packages should be added.

Answered By: tyleax

I used this command to resolve my error.

pip install webdriver_manager

Answered By: Greg W.F.R

Install selenium and webdriver-manager from the option "python package" directly in the pycharm solve my problem

Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.