0

I'm rather new to coding, so please bare with me if I'm not using the optimal terminology to ask this question. I've installed and set up python on my Mac using pyenv based on the following link:

https://opensource.com/article/19/5/python-3-default-mac

I'm currently trying to execute a program, but I receive a ModuleNotFoundError on Numpy upon execution.

Traceback (most recent call last): 
File "<pyshell#0>", line 1, in <module>
import numpy
ModuleNotFoundError: No module named 'numpy'

I've checked via terminal and ensured numpy is installed, I went through the pyenv source files and confirmed numpy is there, and tried the "python -mpip install numpy" method to no avail. I'm not sure what to do at this point, so any of your suggestions would be greatly appreciated! Thank you!

2
  • Have you tried typing python3 in terminal instead of just python when running the script? Commented Oct 4, 2020 at 2:59
  • Hey Chris, I confirmed that it's python3 that contains numpy installed in it, so I guess I have? I know the program I'm running is running under the same python version as the one I'm confirming has numpy installed within terminal, and that is python 3 (v 3.8.5) Commented Oct 4, 2020 at 3:18

1 Answer 1

0

Try to check the pip location with the command

pyenv which pip

And use the output to install numpy in the correct environment, for example:

C:\Users\username\.pyenv\pyenv-win\versions\3.10.5\Scripts\pip.exe install numpy

You can, alternatively, fix the "pip" alias as suggested here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.