Home > Mobile >  Tabulate installed but interpreter can't resolve the import
Tabulate installed but interpreter can't resolve the import

Time:12-11

I've written a script to use the tabulate library, but for some reason the script isn't able to resolve the import. when I run pip install tabulate into my terminal I get this:

Requirement already satisfied: tabulate in c:\python39\lib\site-packages (0.8.9)

so tabulate should already be installed, but my script gives this error:

import "tabulate" could not be resolved from source" Pylance(reportMissingModuleSource)

I've installed many other libraries and they're working fine, but for some reason I can't get this one to work.

For reference here's the call in my script:

from tabulate import tabulate

I've also run the pip install tabulate from the windows command prompt, from vscode (the text editor I'm writing in), and from the python application where the command doesn't seem to work at all. This is on python 3.9. I've also tried other variations of the pip install command, they all return the same "Requirement already satisfied" message.

CodePudding user response:

Change your interpreter in vscode!

Go to:

View > Command Palette.

Then type this:

Python: Select Interpreter

Then choose the one that installed in that directory(the "python39" dir in this your case!).

I hope this would be helpful.

  • Related