0

I have just downloaded Visual Studio Code and tried to run some Python code. However, when I try to import Seleinum I receive the following error:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

Erros:
module selenium
unresolved import 'selenium'Python(unresolved-import)
unresolved import 'selenium.webdriver.common.keys' Python(unresolved-import)

Any idea how to make it work?

1

1 Answer 1

0

The links below address the issue you are having. Your workspace settings are improperly configured. By adding the PATH of the virtual environment library/packages to the workspace settings, settings.json, file will correct the issue.

An example of my configuration in Windows 10:

"python.pythonPath": "C:\\Users\\UserName\\python-virtual-environments\\env\\lib",

Pylint "unresolved import" error in visual studio code

https://code.visualstudio.com/docs/getstarted/settings#_settings-file-locations

Sign up to request clarification or add additional context in comments.

2 Comments

Where must i paste this Code?
Under workspace settings in the settings.json file. I included links as to where I obtained the information. I tested it to make sure it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.