On Jul 13, 2025, at 04:00, Christoph Kukulies wrote:
> 
> In a notebook I'm getting:
> ---------------------------------------------------------------------------
> ModuleNotFoundError                       Traceback (most recent call last)
> Cell In[4], line 2
>       1 #%matplotlib inline
> ----> 2 import matplotlib.pyplot as plt
>       3 import numpy as np
>       4 import csv
> 
> ModuleNotFoundError: No module named 'matplotlib'
> 
> 
> port installed | grep matplotlib
>   py311-matplotlib-inline @0.1.7_0 (active)
>   py313-matplotlib-inline @0.1.7_0 (active)

Have you tried installing the py311-matplotlib port?


> $ pip install matplotlib
> Requirement already satisfied: matplotlib in 
> /usr/local/lib/python3.11/site-packages (3.10.3)

Things in /usr/local are not provided by MacPorts. I recommend you remove what 
you have installed there to avoid confusion. 

On an Intel Mac items in /usr/local may be provided by Homebrew if you have 
that installed. If so, I recommend you uninstall it. Use either MacPorts or 
Homebrew but not both. 

You probably don't want to run "pip install" except when in a virtualenv. When 
not in a virtualenv, I think "pip install" will install into the system prefix 
which would interfere with software installed by "the system" (e.g. Homebrew or 
MacPorts). Instead, install the MacPorts port for the module you want. 


Reply via email to