gokul_santhosh
gokul_santhosh

Reputation: 303

Unable to import 'selenium' : pylint(import-error)

I created a virtual environment and tried to import selenium inside one of the python files I have inside that venv and it's throwing me this error.

Both my python3 and pip3 have the same source.

I tried pip3 install selenium and python3 -m pip install -U selenium, both didn't work.

I can import the selenium package from the command line without any problem. Will this be any problem with my text editor? I'm using vscode.

Upvotes: 1

Views: 840

Answers (1)

gokul_santhosh
gokul_santhosh

Reputation: 303

My python interpreter inside vscode was pointing to another version of python. I changed that to pyton3 and it worked. To change the python3 interpreter, open command palette(ctrl+shift+p) and search for, Python : Select Interpreter. Now change that to the correct path and you're good to go.

Upvotes: 1

Related Questions