IDLE出现 ModuleNotFoundError: No module named 'numpy'

Checked on the terminal and found that the numpy library has been referenced, but when numpy was referenced in IDLE, there was an error that numpy could not be found. After some investigation, it was found that the reason for the occurrence of **ModuleNotFoundError: No module named'numpy'** was: installation IDLE is the Python 3.6 version, but the Mac system installs Python 2.7 by default, so the numpy I checked belongs to the Python 2.7 version. If there are multiple Python versions at the same time as on my Mac computer, then when downloading numpy, execute the
Python2 execution command in different versions :

python2 -m pip install numpy

Python3 executes the command :

python3 -m pip install numpy

When Successfully installed numpy-1.16.2such a sentence appears, it means that the numpy library has been downloaded successfully, and then import numpy will not report an error.

Guess you like

Origin blog.csdn.net/u010670117/article/details/89003965