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?

Lidor Amrani
  • 1
  • 1
  • 1
  • You can refer to this question - https://stackoverflow.com/questions/53939751/pylint-unresolved-import-error-in-visual-studio-code – Aravind Aug 14 '19 at 07:55

1 Answers1

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