I grabbed scipy from CVS and built it last night, and I get an error when I try to use it: ImportError: No module named fastumath Some details on my system: OS: Linux, Mandrake 8.1 Python: python-2.1 Numerical: latest from CVS as of last night, 22.0a fypy2e: latest from CVS as of last night, 2.1.13.175.1250 ATLAS: 3.3.14 LAPACK: 3.0 When I look in /usr/lib/python2.1/site-packages/scipy_base, there is a file fastumath.so, so I am puzzled as to why the statement 'import scipy_base.fastumath' fails in scipy_base/__init__.py. Any suggestions welcome... Thanks, Carl Here is the debugging output: [staelin@firewall scipy]$ python -v # /usr/lib/python2.1/site.pyc matches /usr/lib/python2.1/site.py import site # precompiled from /usr/lib/python2.1/site.pyc # /usr/lib/python2.1/os.pyc matches /usr/lib/python2.1/os.py import os # precompiled from /usr/lib/python2.1/os.pyc import posix # builtin # /usr/lib/python2.1/posixpath.pyc matches /usr/lib/python2.1/posixpath.py import posixpath # precompiled from /usr/lib/python2.1/posixpath.pyc # /usr/lib/python2.1/stat.pyc matches /usr/lib/python2.1/stat.py import stat # precompiled from /usr/lib/python2.1/stat.pyc # /usr/lib/python2.1/UserDict.pyc matches /usr/lib/python2.1/UserDict.py import UserDict # precompiled from /usr/lib/python2.1/UserDict.pyc Python 2.1.1 (#1, Aug 30 2001, 17:36:05) [GCC 2.96 20000731 (Mandrake Linux 8.1 2.96-0.61mdk)] on linux-i386 Type "copyright", "credits" or "license" for more information. import readline # dynamically loaded from /usr/lib/python2.1/lib-dynload/readline.so
import scipy import scipy # directory /usr/lib/python2.1/site-packages/scipy # /usr/lib/python2.1/site-packages/scipy/__init__.pyc matches /usr/lib/python2.1/site-packages/scipy/__init__.py import scipy # precompiled from /usr/lib/python2.1/site-packages/scipy/__init__.pyc # /usr/lib/python2.1/site-packages/scipy/scipy_version.pyc matches /usr/lib/python2.1/site-packages/scipy/scipy_version.py import scipy.scipy_version # precompiled from /usr/lib/python2.1/site-packages/scipy/scipy_version.pyc # /usr/lib/python2.1/site-packages/scipy/__cvs_version__.pyc matches /usr/lib/python2.1/site-packages/scipy/__cvs_version__.py import scipy.__cvs_version__ # precompiled from /usr/lib/python2.1/site-packages/scipy/__cvs_version__.pyc # /usr/lib/python2.1/site-packages/Numeric/Numeric.pyc matches /usr/lib/python2.1/site-packages/Numeric/Numeric.py import Numeric # precompiled from /usr/lib/python2.1/site-packages/Numeric/Numeric.pyc # /usr/lib/python2.1/site-packages/Numeric/numeric_version.pyc matches /usr/lib/python2.1/site-packages/Numeric/numeric_version.py import numeric_version # precompiled from /usr/lib/python2.1/site-packages/Numeric/numeric_version.pyc import _numpy # dynamically loaded from /usr/lib/python2.1/site-packages/Numeric/_numpy.so import multiarray # dynamically loaded from /usr/lib/python2.1/site-packages/Numeric/multiarray.so import umath # dynamically loaded from /usr/lib/python2.1/site-packages/Numeric/umath.so # /usr/lib/python2.1/site-packages/Numeric/Precision.pyc matches /usr/lib/python2.1/site-packages/Numeric/Precision.py import Precision # precompiled from /usr/lib/python2.1/site-packages/Numeric/Precision.pyc # /usr/lib/python2.1/string.pyc matches /usr/lib/python2.1/string.py import string # precompiled from /usr/lib/python2.1/string.pyc import strop # dynamically loaded from /usr/lib/python2.1/lib-dynload/strop.so # /usr/lib/python2.1/types.pyc matches /usr/lib/python2.1/types.py import types # precompiled from /usr/lib/python2.1/types.pyc import math # dynamically loaded from /usr/lib/python2.1/lib-dynload/math.so # /usr/lib/python2.1/site-packages/Numeric/ArrayPrinter.pyc matches /usr/lib/python2.1/site-packages/Numeric/ArrayPrinter.py import ArrayPrinter # precompiled from /usr/lib/python2.1/site-packages/Numeric/ArrayPrinter.pyc # /usr/lib/python2.1/pickle.pyc has bad mtime import pickle # from /usr/lib/python2.1/pickle.py # can't create /usr/lib/python2.1/pickle.pyc # /usr/lib/python2.1/copy_reg.pyc matches /usr/lib/python2.1/copy_reg.py import copy_reg # precompiled from /usr/lib/python2.1/copy_reg.pyc import marshal # builtin import struct # dynamically loaded from /usr/lib/python2.1/lib-dynload/struct.so# /usr/lib/python2.1/re.pyc matches /usr/lib/python2.1/re.py import re # precompiled from /usr/lib/python2.1/re.pyc # /usr/lib/python2.1/sre.pyc matches /usr/lib/python2.1/sre.py import sre # precompiled from /usr/lib/python2.1/sre.pyc # /usr/lib/python2.1/sre_compile.pyc matches /usr/lib/python2.1/sre_compile.py import sre_compile # precompiled from /usr/lib/python2.1/sre_compile.pyc import _sre # builtin # /usr/lib/python2.1/sre_constants.pyc matches /usr/lib/python2.1/sre_constants.py import sre_constants # precompiled from /usr/lib/python2.1/sre_constants.pyc # /usr/lib/python2.1/sre_parse.pyc matches /usr/lib/python2.1/sre_parse.py import sre_parse # precompiled from /usr/lib/python2.1/sre_parse.pyc # /usr/lib/python2.1/StringIO.pyc has bad mtime import StringIO # from /usr/lib/python2.1/StringIO.py # can't create /usr/lib/python2.1/StringIO.pyc import errno # dynamically loaded from /usr/lib/python2.1/lib-dynload/errno.so # /usr/lib/python2.1/copy.pyc matches /usr/lib/python2.1/copy.py import copy # precompiled from /usr/lib/python2.1/copy.pyc import scipy_base # directory scipy_base # scipy_base/__init__.pyc matches scipy_base/__init__.py import scipy_base # precompiled from scipy_base/__init__.pyc Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.1/site-packages/scipy/__init__.py", line 29, in ? from scipy_base import * File "scipy_base/__init__.py", line 4, in ? import scipy_base.fastumath ImportError: No module named fastumath
On Sat, 27 Apr 2002, Carl Staelin wrote:
I grabbed scipy from CVS and built it last night, and I get an error when I try to use it: ImportError: No module named fastumath <snip>
When I look in /usr/lib/python2.1/site-packages/scipy_base, there is a file fastumath.so, so I am puzzled as to why the statement 'import scipy_base.fastumath' fails in scipy_base/__init__.py.
Any suggestions welcome...
Can you import fastumath directly? E.g. cd /usr/lib/python2.1/site-packages/scipy_base python
import fastumath
Can you import scipy_base directly? E.g. cd - python
import scipy_base
Can you import scipy_base.fastumath directly? E.g. cd - python
import scipy_base.fastumath
Pearu
I've seen this occassionally (during "cvs update -Pd ; python ./setup build ; python ./setup install cycles). The solution was to go into the right place and manually run setup_scipy_base.py (or the similar equivalent when it was somewhere else). But it seems like years since I did any scipy evaluation... best, -tony
"pearu" == Pearu Peterson <pearu@cens.ioc.ee> writes:
pearu> On Sat, 27 Apr 2002, Carl Staelin wrote: >> I grabbed scipy from CVS and built it last night, and I get >> an error when I try to use it: >> ImportError: No module named fastumath pearu> <snip> >> >> When I look in /usr/lib/python2.1/site-packages/scipy_base, >> there is a file fastumath.so, so I am puzzled as to why the >> statement 'import scipy_base.fastumath' fails in >> scipy_base/__init__.py. >> >> Any suggestions welcome... pearu> Can you import fastumath directly? pearu> E.g. pearu> cd /usr/lib/python2.1/site-packages/scipy_base pearu> python >>>> import fastumath pearu> Can you import scipy_base directly? pearu> E.g. pearu> cd - pearu> python >>>> import scipy_base pearu> Can you import scipy_base.fastumath directly? pearu> E.g. pearu> cd - pearu> python >>>> import scipy_base.fastumath pearu> Pearu pearu> _______________________________________________ pearu> SciPy-user mailing list pearu> SciPy-user@scipy.net pearu> http://www.scipy.net/mailman/listinfo/scipy-user -- A.J. Rossini Rsrch. Asst. Prof. of Biostatistics U. of Washington Biostatistics rossini@u.washington.edu FHCRC/SCHARP/HIV Vaccine Trials Net rossini@scharp.org -------------- http://software.biostat.washington.edu/ ---------------- FHCRC: M-W: 206-667-7025 (fax=4812)|Voicemail is pretty sketchy/use Email UW: Th: 206-543-1044 (fax=3286)|Change last 4 digits of phone to FAX (my friday location is usually completely unpredictable.)
I get this error when I try and run python from the main scipy build directory. If you checkout scipy and are in the scipy directory when you run python, Python tries to load modules and packages from the current directory, (and naturally does not find the compiled modules which are in the build/ subtree. Try going to your home directory before you run python. -Travis
I've just run up against the "no module fastumath" problem. Moving the working directory back to my home directory didn't fix this, because I had checked out the scipy module from CVS into my home directory, which creates a "scipy" subdirectory automatically. Thus python was searching my CVS-tree from the modules. Trivial solution: move the scipy CVS directory out of my home/working directory. Ideally the CVS module name would be different from the python module name. Can you change CVS module names without messing things up (to Scipy instead of scipy, for example)? Bryan On Sat, 2002-04-27 at 17:54, Travis Oliphant wrote:
I get this error when I try and run python from the main scipy build directory.
If you checkout scipy and are in the scipy directory when you run python,
Python tries to load modules and packages from the current directory, (and naturally does not find the compiled modules which are in the build/ subtree.
Try going to your home directory before you run python.
-Travis
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.net http://www.scipy.net/mailman/listinfo/scipy-user
-- Bryan Cole Teraview Ltd., 302-304 Cambridge Science Park, Milton Road, Cambridge CB4 0WG, United Kingdom. tel: +44 (1223) 435380 / 435386 (direct-dial) fax: +44 (1223) 435382
On 15 Aug 2002, bryan cole wrote:
I've just run up against the "no module fastumath" problem.
Moving the working directory back to my home directory didn't fix this, because I had checked out the scipy module from CVS into my home directory, which creates a "scipy" subdirectory automatically. Thus python was searching my CVS-tree from the modules.
Trivial solution: move the scipy CVS directory out of my home/working directory.
Ideally the CVS module name would be different from the python module name. Can you change CVS module names without messing things up (to Scipy instead of scipy, for example)?
Why don't you rename it yourself? After cvs -d ... checkout scipy do mv scipy scipy_cvs and the problem is solved (you can then do 'cvs update' inside scipy_cvs, for instance). It would be much more difficult to change the name in the CVS server and, personally, I don't see any point in that. Btw, I keep all CVS versions of various software in one directory named as `cvs'. I never use python in that directory which avoids messing things up. Regards, Pearu
participants (5)
-
bryan cole
-
Carl Staelin
-
Pearu Peterson
-
rossini@blindglobe.net
-
Travis Oliphant