我是一名新手程序员,正在尝试导入scipy。
问题:
当我在终端中的Python解释器中尝试导入scipy时,它看起来像这样:
当我运行“port contents py27-packagename”时,我得到
问题:
当我在终端中的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
>>>
我似乎已经正确安装了MacPorts。我可以像上面那样成功导入numpy。
我最初按照“macports”说明在http://www.scipy.org/install.html上安装了scipy。
即:
sudo port install py27-numpy py27-scipy py27-matplotlib py27-ipython +notebook py27-pandas py27-sympy py27-nose
我按照这篇文章做了: Python will not recognize MacPorts installed packages 但似乎无法得出答案。
为了澄清:
当我运行"which python", 会得到以下结果:
/usr/bin/python
当我运行“port contents py27-packagename”时,我得到
Port py27-packagename is not installed.
提前感谢