[SciPy-user] import failure using g77

Pearu Peterson pearu at cens.ioc.ee
Sat Oct 19 14:36:35 EDT 2002


On Sat, 19 Oct 2002, Jeffrey B. Layton wrote:

> Hey!
> 
>    I finally listened to Pearu and built SciPy with g77!
> However, I built g77 from gcc-3.1.1 that I installed
> locally in my home directory (this could be the cause
> of the problem).

(Yes, you might need to fix this using LD_LIBRARY_PATH, see below.)

>    I built ATLAS, LAPACK, etc. with gcc-3.1.1.
> I then built/installed SciPy using the command:
> 
> /usr/bin/python2.2 setup.py build build_flib --fcompiler=Gnu install
> 
> (I had previously installed fftw, Numeric, and f2py).
> Everything good so far.
>    So, I start up python2.2 and try to import scipy. Here's
> what I got:
> 
> [laytonj at home3 scipy]$ /usr/bin/python2.2
> Python 2.2 (#1, Apr 12 2002, 15:29:57)
> [GCC 2.96 20000731 (Red Hat Linux 7.2 2.96-109)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import scipy
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/lib/python2.2/site-packages/scipy/__init__.py", line 30, in ?
>     import Numeric
>   File "/usr/lib/python2.2/site-packages/Numeric/Numeric.py", line 133, in ?
>     import multiarray
> ImportError: libgcc_s.so.1: cannot open shared object file: No such file 
> or directory
>  >>>
> 
> 
>    Could this be because I built SciPy with gcc-3.1.1 and
> python2.2 was built with gcc-2.96? 

It shouldn't be. I am succesfully using extension modules built with
gcc-3.1.1 in python2.2 that is built with gcc-2.95.4.

> Or could this be a bum gcc build? Perhaps a problem with my library
> directories?

Could be. libgcc_s.so should be in /path/to/lib/gcc-lib/i386-linux/3.1.1.
If it exists there, a quick fix would be defining an environment variable
LD_LIBRARY_PATH, e.g.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/lib/gcc-lib/i386-linux/3.1.1

but read on.

Also note that the import problem above is not due to Scipy but comes from
Numeric import. I bet, direct 'import Numeric' will also fail. May be
rebuilding Numeric will fix the problem.

HTH,
	Pearu





More information about the SciPy-User mailing list