用macports安装scipy时出现问题

Sam*_*mmy 4 installation macports scipy python-2.7

我是编程和尝试导入scipy的新手.

问题:

当我尝试在终端中的python解释器中导入scipy时,它看起来像这样:

[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named scipy
>>> 
Run Code Online (Sandbox Code Playgroud)

我似乎正确安装了macports.我可以像上面一样成功导入numpy.

我最初根据http://www.scipy.org/install.html上的"macports"说明安装了scipy

即:

sudo port install py27-numpy py27-scipy py27-matplotlib py27-ipython +notebook py27-pandas py27-sympy py27-nose
Run Code Online (Sandbox Code Playgroud)

我也遵循了这篇文章: Python不会识别MacPorts安装的软件包

但似乎无法为自己找到答案

澄清:

当我运行"哪个python"时,我得到了

/usr/bin/python
Run Code Online (Sandbox Code Playgroud)

当我运行"端口内容py27-packagename"时,我得到了

Port py27-packagename is not installed.
Run Code Online (Sandbox Code Playgroud)

提前致谢

nev*_*nic 12

安装python模块时,MacPorts不会触及系统python.它确实为自己的python版本安装了这些模块,/opt/local/bin/python2.7默认情况下是这样.您可以将它设置为使用时键入pythonshell 时要运行的默认python sudo port select --set python python27.