skip to Main Content

I’m trying to run the following code in VS Code:

import pandas as pd

df = pd.read_csv('data.csv')

But it shows the problem:
enter image description here

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:
enter image description here

I tried this solution, but it didn’t work.

2

Answers


  1. Chosen as BEST ANSWER

    Resetting VS Code by deleting all the content in settings.json and replacing it with a simple {} helped me.


  2. 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.

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search