[SciPy-User] specify libgfortran.dylib location

Robert Felty robfelty@gmail....
Thu Nov 12 17:29:38 CST 2009


I've been trying to get scipy working on snow leopard for several  
weeks now. I have seen several blogs with lots of suggestions, but  
none have worked for me, until I finally figured it out today.
I kept getting an error that my libgfortan.dylib file was the wrong  
architecture. Here is the stack trace:
 >>> import scipy.stats
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/Library/Python/2.6/site-packages/scipy-0.8.0.dev5975-py2.6- 
macosx-10.6-universal.egg/scipy/stats/__init__.py", line 7, in <module>
     from stats import *
   File "/Library/Python/2.6/site-packages/scipy-0.8.0.dev5975-py2.6- 
macosx-10.6-universal.egg/scipy/stats/stats.py", line 198, in <module>
     import scipy.special as special
   File "/Library/Python/2.6/site-packages/scipy-0.8.0.dev5975-py2.6- 
macosx-10.6-universal.egg/scipy/special/__init__.py", line 8, in  
<module>
     from basic import *
   File "/Library/Python/2.6/site-packages/scipy-0.8.0.dev5975-py2.6- 
macosx-10.6-universal.egg/scipy/special/basic.py", line 8, in <module>
     from _cephes import *
ImportError: dlopen(/Library/Python/2.6/site-packages/ 
scipy-0.8.0.dev5975-py2.6-macosx-10.6-universal.egg/scipy/special/ 
_cephes.so, 2): Library not loaded: /usr/local/lib/libgfortran.2.dylib
   Referenced from: /Library/Python/2.6/site-packages/ 
scipy-0.8.0.dev5975-py2.6-macosx-10.6-universal.egg/scipy/special/ 
_cephes.so
   Reason: no suitable image found.  Did find:
	/usr/local/lib/libgfortran.2.dylib: mach-o, but wrong architecture
	/usr/local/lib/libgfortran.2.dylib: mach-o, but wrong architecture

I discovered today that I had several different libgfortran files:
/usr/local/lib/libgfortran.2.0.0.dylib
/usr/local/lib/libgfortran.2.dylib
/usr/local/lib/libgfortran.a
/usr/local/lib/libgfortran.dylib
/usr/local/lib/libgfortran.la
/usr/local/lib/ppc64/libgfortran.2.0.0.dylib
/usr/local/lib/ppc64/libgfortran.2.dylib
/usr/local/lib/ppc64/libgfortran.a
/usr/local/lib/ppc64/libgfortran.dylib
/usr/local/lib/ppc64/libgfortran.la
/usr/local/lib/x86_64/libgfortran.2.0.0.dylib
/usr/local/lib/x86_64/libgfortran.2.dylib
/usr/local/lib/x86_64/libgfortran.a
/usr/local/lib/x86_64/libgfortran.dylib
/usr/local/lib/x86_64/libgfortran.la

I tried copying the x86_64 file to /usr/local/lib, and now scipy  
works. However, this does not seem like the right way to do it. Is  
there a way to tell scipy that it should use the version in /usr/local/ 
lib/x86_64?
I am using system Python 2.6.1 on Mac 10.6.1, which scipy 0.8.0

Thanks in advance for any suggestions.

Rob



More information about the SciPy-User mailing list