I’m trying to run the following code in VS Code:
import pandas as pd
df = pd.read_csv('data.csv')
This didn’t happen before.
The other solutions I saw didn’t seem to work.
This same problem happens with virtually any package I import. A few of them are:
I tried this solution, but it didn’t work.
2
Answers
Resetting VS Code by deleting all the content in
settings.json
and replacing it with a simple{}
helped me.Update your Pylance version can solve this according to the pre-release on github.
You can also switch to the pre-release version in extension store.