The solutions above didn't work for me. But if you try with a virtual env it should go away.
python3 -m venv venv source venv/bin/activate pip install numpy matplotlib
then run the script from within the venv.