简体   繁体   中英

Import "urllib3" could not be resolved from sourcePylancereportMissingModuleSource

I am new to Python and writing a lambda function. I installed urllib3 using pip but still getting this following error.

在此处输入图像描述

I tried restarting vscode/ uninstall and reinstall but still getting the error.

this is the result when I run pip show urllib3

在此处输入图像描述

what am i missing here?

Maybe there is more than one python environment on your machine, And the location where you installed the package is inconsistent with the python interpreter you are using now.

You can use CTRL + SHIFT + P to open the command palette and search Python: Select Interpreter (or click on the interpreter version displayed in the lower right corner).

在此处输入图像描述

Select the environment interpreter where you have the urllib3 package installed.

You need to make sure that VS Code uses the same Python Interpreter that you installed this package to.

You can see it here:

在此处输入图像描述

Looks like yours should point to

c:\user\###\appdata\local\programs\python\python39\bin\python

(or something like that, where your python executable file is located)

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