ModuleNotFoundError on .ipynb

44 Views Asked by At

This is from a .ipynb jupyter notebook in vscode in windows 10:

even when I pip install pandas in the terminal it still gives this error:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 2
      1 import numpy as np
----> 2 import pandas as pd
      3 import matplotlib.pyplot as plt
      5 # pip install wheel webencodings jinja2 packaging markupsafe werkzeug flatbuffers libclang typing-extensions wrapt

ModuleNotFoundError: No module named 'pandas'

I tried typing 'pip install pandas' in my vscode terminal and it showed this:

Requirement already satisfied: pandas in c:\users\s2hun\desktop\machine learning intro\magic\lib\site-packages (2.2.1)
Requirement already satisfied: numpy<2,>=1.26.0 in c:\users\s2hun\desktop\machine learning intro\magic\lib\site-packages (from pandas) (1.26.4)
Requirement already satisfied: python-dateutil>=2.8.2 in c:\users\s2hun\desktop\machine learning intro\magic\lib\site-packages (from pandas) (2.9.0.post0)
Requirement already satisfied: pytz>=2020.1 in c:\users\s2hun\desktop\machine learning intro\magic\lib\site-packages (from pandas) (2024.1)
Requirement already satisfied: tzdata>=2022.7 in c:\users\s2hun\desktop\machine learning intro\magic\lib\site-packages (from pandas) (2024.1)
Requirement already satisfied: six>=1.5 in c:\users\s2hun\desktop\machine learning intro\magic\lib\site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)

I then ran the cell which contained this code:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

When I did so the following error appeared:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[2], line 2
      1 import numpy as np
----> 2 import pandas as pd
      3 import matplotlib.pyplot as plt
      5 # pip install wheel webencodings jinja2 packaging markupsafe werkzeug flatbuffers libclang typing-extensions wrapt

ModuleNotFoundError: No module named 'pandas'

I don't know how to fix this and I have had the same problem installing various other python modules in the past.

0

There are 0 best solutions below