Skip to content
Advertisement

Unresolved imports in VSCode Python

While programming in VSCode, Python I imported a module named Selenium. However, VS Code is Showing me an error, saying unresolved import selenium. I had installed selenium yesterday only using the pip command. Please do help me out

Advertisement

Answer

It is recommended that you use the command “python --version“(or python3 --version) in the VS Code terminal to check whether the python used in the terminal is the same as the one displayed in the lower left corner of VS Code, or use “pip --version“(or pip3 --version) to check the source of the module installation tool “pip”, the module is installed at this location:

enter image description here

If the python results displayed are inconsistent, please use the shortcut key Ctrl+Shift+` to open a new VS Code terminal, it will automatically enter the python environment selected in the lower left corner of VS Code.

check: (pip show selenium)

enter image description here

Run:

enter image description here

In addition, please try to reload VS Code after installation to make it recognize this module.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement