skip to Main Content

I have recently installed 3 libraries: PyPDF2, discord and requests(used pip install ___). But when I import them Visual Studio gives the reportMissingImports(in requests’ case, it gives "reportMissingModuleSource") error.
For the pip installment I just opened cmd and wrote everything. Could be a problem with PATH? But unfortunately I do not know how to solve that either.

3

Answers


  1. Did you do it in command or in the Visual Studio Codes terminal?

    Try both.

    If that did not work check out this. Its with Flask but has the same fundamental problem:

    Import "flask" could not be resolved from source Pylance (reportMissingModuleSource)

    Login or Signup to reply.
  2. I recently had the same problem. It turned out to be a problem with different versions of python – you install the libraries on one version but launch another version.

    Try pressing "Ctrl + Shift + P" and then typing "Python: Select Interpreter" and select one of those available.

    Then try your code with the other versions.

    By the way, did you install Python with installer or with MS store?

    Login or Signup to reply.
  3. try install them in vscode terminal as same as cmd

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search