Home > Net >  Import "urllib3" could not be resolved from sourcePylancereportMissingModuleSource
Import "urllib3" could not be resolved from sourcePylancereportMissingModuleSource

Time:07-13

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

enter image description here

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

this is the result when I run pip show urllib3

enter image description here

what am i missing here?

CodePudding user response:

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

You can see it here:

enter image description 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)

CodePudding user response:

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).

enter image description here

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

  • Related