0

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
3
  • 2
    Try python3 -m pip install numpy Commented Dec 29, 2019 at 18:37
  • what does python3 --version output? also are you sure pip3 is pointing to the python3 environment, it's possible it is not Commented Dec 29, 2019 at 18:37
  • thanks @IainShelvington it solve my problem !!! Commented Dec 29, 2019 at 18:45

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.