matplotlib - import issues using jupyter notebook python via VSCode (RESOLVED) - Stack Overflow

admin2025-03-20  5

I am trying to run the following Code Snippet in a Jupyter Notebook (Python) via VSCode and I am getting the following error:

import matplotlib.pyplot as plt
from scipy.integrate import odeint

Error:

{
    "name": "ModuleNotFoundError",
    "message": "No module named 'matplotlib'",
    "stack": "---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[2], line 3
      2 import numpy as np
----> 3 import matplotlib.pyplot as plt
      4 from scipy.integrate import odeint

ModuleNotFoundError: No module named 'matplotlib'"

I checked the active Virtual environment and I am certain its the right one. Its the only one the ipykernel is even installed in and I installed and uninstalled matplotlib multiple times. Any help would be greatly appreciated, as far as I can see, most similiar issues were resolved by switching to the right venv.

EDIT

Looks like the issue was caused by moving my venv into this project, which caused matplot to not install properly. Creating a new venv resolved the issue.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1742416949a212713.html

最新回复(0)