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.
Asked
Active
Viewed 54 times
-1
-
2You most likely have a mismatch between the Python instance (version, venv) you installed the libraries for and the one you have [selected in VSC](https://code.visualstudio.com/docs/python/environments). – Klaus D. Aug 06 '23 at 12:03
2 Answers
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?

quamrana
- 37,849
- 12
- 53
- 71

pythoncraft
- 86
- 6
-
I first installed Python from the official website. But then when I wrote 'python' on cmd the microsoft store link to python came too. So I installed that as well. – iamnotgoodatthis Aug 06 '23 at 13:48
-
When I chose the Microsoft Store version as the interpreter it worked. Thank you! – iamnotgoodatthis Aug 06 '23 at 13:49
0
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)

Hansolo414
- 16
- 4