'VSCode - import errors and interpreter errors

I have several imports in my current code:

from flask import Flask
import datetime as dt
import numpy as np
import pandas as pd

When I run this in VSCODE I am getting this error: this error

However, running this in jupyter notebook has no problems. When I looked online it said to use python interpreter but when I go to do that I get this error: 2

And another error:

Anaconda prompt says modules/packages are installed but when I run pip install in default windows terminal it says pip has no module:  has no module



Solution 1:[1]

Delete and reinstall Python extensions according to the same problem on github.

The second problem is related to the location of your Python interpreter. You need to choose the correct interpreter. I still recommend using one Python version in one environment. You can use other Python versions in virtual environment, so it won't lead to confusion.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MingJie-MSFT