Q:

Python does not finding installed library

I have recently come across to this error: 
~/Works/PolymerAnimation/PDF_try » python3 slope.py                                                       marco@MPB-2^Q5Ghz-16Gb
Traceback (most recent call last):
  File "slope.py", line 4, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'
---------------------------------------------------------------------------------------------------------------------------------
~/Works/PolymerAnimation/PDF_try » pip3 install numpy                                                     marco@MPB-2^Q5Ghz-16Gb
Requirement already satisfied: numpy in /usr/local/lib/python3.7/site-packages (1.18.0)

I have a 2012 macbook pro and since today I never have problem using python, I have also installed numpy using homebrew (package manager for mac) ... I don't know what's going on! Numpy is not a unique module that is give me this problem ... but all the module .. like matplotlib and so on! 

A:

Your python3 and pip3 are pointing to two different python versions. That's what caused the problem.
According to Iain's answer-
python3 -m pip install package_name

should solve the problem.

