NumericalPy Tutorial __init__.py
takeuchi at isl.ntt.co.jp
takeuchi at isl.ntt.co.jp
Mon May 17 04:03:22 EDT 1999
<373e1f03.e2de0b9- at swcp.com> wrote:
Original Article: http://www.egroups.com/list/python-list/?start=58960
> Having trouble loading the NumTut module (tutorial for Numerical Python
> package) I think I have all the appropriate files installed. Any
> suggestions would be appreciated! Here is some interactive which
> illustrates the problem
>
> Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>> array_constructor
> Traceback (innermost last):
> File "<stdin>", line 1, in ?
> NameError: array_constructor
> >>> from Numeric import *
> >>> array_constructor
> <function array_constructor at 7aff00>
> >>> from NumTut import *
> Traceback (innermost last):
> File "<stdin>", line 1, in ?
> File "D:\Program Files\Python\NumTut\__init__.py", line 15, in ?
> greece = pickle.load(open(os.path.join(_dir, 'greece.pik'), 'rb')) /
> 256.0
> File "D:\Program Files\Python\Lib\pickle.py", line 826, in load
> return Unpickler(file).load()
> File "D:\Program Files\Python\Lib\pickle.py", line 495, in load
> dispatch[key](self)
> File "D:\Program Files\Python\Lib\pickle.py", line 659, in load_global
> klass = self.find_class(module, name)
> File "D:\Program Files\Python\Lib\pickle.py", line 669, in find_class
> raise SystemError, \
> SystemError: Failed to import class array_constructor
> from module Numeric
>
>
> >>>
>
This may be a cure.
Change 'rb' to 'r' in the 14th line of __init__.py like this.
pickle.load(open(os.path.join(_dir, 'greece.pik'), 'r'))
^^^^^
--
takeuchi
More information about the Python-list
mailing list