Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Tabulate installed but interpreter can't resolve the import

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading