Python 在Mac上空闲时导入numpy时出错

Python 在Mac上空闲时导入numpy时出错,python,macos,numpy,Python,Macos,Numpy,我正在使用mac电脑,当我尝试在空闲时导入numpy时,它会显示以下内容: File "/Users/muchen/Desktop/Pelt implementation/pymrfbp-1.12/examples/numpy/__init__.py", line 170, in <module> raise ImportError(msg) ImportError: Error importing numpy: you should not try to import numpy

我正在使用mac电脑,当我尝试在空闲时导入numpy时,它会显示以下内容:

File "/Users/muchen/Desktop/Pelt implementation/pymrfbp-1.12/examples/numpy/__init__.py", line 170, in <module>
raise ImportError(msg)
ImportError: Error importing numpy: you should not try to import numpy from
    its source directory; please exit the numpy source tree, and relaunch
    your python interpreter from there.
File”/Users/muchen/Desktop/Pelt implementation/pymrfbp-1.12/examples/numpy/_init__.py“,第170行,在
提高效率(msg)
ImportError:导入numpy时出错:不应尝试从导入numpy
其源目录;请退出numpy源代码树,然后重新启动
你的python解释器就在那里。

我知道这可能是一个重复的问题,因为以前有人问过这个问题,但我没有在我的Mac上得到一个可行的解决方案。我希望有一个循序渐进的指南。另一个问题是我需要安装numpy吗?我刚下载并解压,但如何在Mac上安装呢?我还需要一个循序渐进的指导。

您问题第一部分的答案在这里

you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
只需从任何其他位置启动解释器。例如,从
$HOME/myproject
文件夹

安装numpy最简单的方法是使用
pip
。只需输入终端

pip install numpy

谢谢我这样做了,但随后又出现了另一个错误:
ImportError:没有名为'numpy.linalg'的模块。
。为什么?@Ian试图用
pip
安装numpy,正如我在回答中所写的那样。我又安装了一次,它显示
需求已经满足(使用--upgrade to upgrade):numpy in/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site packages
或者您能告诉我如何卸载,我可以试试吗again@Ian您可以使用
pip uninstall numpy
卸载它。您是否可以添加来自终端的命令
哪个python
哪个idle
的post结果?