0

我已经从 sourceforge (mac osx 10.7) 安装了适用于 Python 2.7 的 SciTools 包。当我像这样导入它时,它不会出错。

import scitools

但是当我尝试像这样导入时(就像在课堂上展示的那样):

from scitools.std import *

我收到以下错误:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    from scitools.std import *
ImportError: No module named std

任何人都知道可能出了什么问题?

4

1 回答 1

2

Your scitools version is too old. The scitools.std module was not introduced until version 0.6.

You have version 0.3 instead, where it is still called scitools.all. From the ChangeLog:

Version 0.6:

[...]

  • The all module is renamed to std, i.e.,

    from scitools.all import *
    

    should now read

    from scitools.std import *
    

    The old name "all" is still available as a synonym for std, implying that old programs will work. (The "all" name is misleading as only a small portion of scitools is actually imported.)

You may want to upgrade your scitools installation to 0.9, the most recent release.

于 2013-04-15T09:59:38.603 回答