简体   繁体   中英

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

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:

在此处输入图像描述

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 )

在此处输入图像描述

Run:

在此处输入图像描述

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

Select on the bottom left (status bar) the proper interpreter for your environment.

If you created a virtual environment, it will be shown with parentheses, as here:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM