我是编程新手并尝试导入 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
>>>
我似乎已经正确安装了macports。我可以像上面一样成功导入numpy。
我最初按照http://www.scipy.org/install.html上的“macports”说明安装了 scipy
IE:
sudo port install py27-numpy py27-scipy py27-matplotlib py27-ipython +notebook py27-pandas py27-sympy py27-nose
我也关注了这篇文章: Python will not identify MacPorts installed packages
但似乎无法为自己找到答案
澄清:
当我运行“which python”时,我得到
/usr/bin/python
当我运行“port contents py27-packagename”时,我得到
Port py27-packagename is not installed.
提前致谢