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!
martineau
124k29 gold badges181 silver badges319 bronze badges
asked Dec 29, 2019 at 18:35
user8953650
1,0309 silver badges24 bronze badges
1 Answer 1
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.
answered Dec 29, 2019 at 19:32
Shahed Mehbub
5801 gold badge3 silver badges8 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-py
python3 -m pip install numpypython3 --versionoutput? also are you surepip3is pointing to thepython3environment, it's possible it is not