[SciPy-User] numpy and scipy on mac osx 10.6.4

Vincent Davis vincent@vincentdavis....
Thu Oct 14 07:50:46 CDT 2010


On Thu, Oct 14, 2010 at 6:03 AM, Massimo Di Stefano
<massimodisasha@gmail.com> wrote:
> i'm tring to figure out my problems .. but no clue yet :-/
>
>
> actually this is the error i'm having with scipy :
>
>
>>>> from scipy.fftpack import fft
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/fftpack/__init__.py", line 10, in <module>
>    from basic import *
>  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/fftpack/basic.py", line 11, in <module>
>    import _fftpack
> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/fftpack/_fftpack.so, 2): no suitable image found.  Did find:
>        /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/fftpack/_fftpack.so: mach-o, but wrong architecture
>>>>
>
>
>
> have you any clu on how to fix it ?

Well I very recently installed on 10.6.4 py27 numpy and scipy from
source. I did not do the py27 batteries included (I should have) The
build script looked good to me for the py27 you installed I was going
to try it today.

This is what I have been doing to install numpy as scipy.
(don't copy and paste, the some of the quote and "-" characters are
not the right ascii)
I am using the att gfortran linked to on the numpy site.

I am going to run through it again today and will let you know

numscon: Needed to build numpy and scipy

   1. git clone http://github.com/cournape/numscons.git
   2. py27 setup.py build
   3. py27 setup.py install

nose: Needed to run numpy.test()
for py3 http://python-nose.googlecode.com/svn/branches/

   1. hg clone https://python-nose.googlecode.com/hg/ python-nose
   2. py27 setup.py build
   3. py27 setup.py install

Numpy 1..5.x source

   1. LDFLAGS="-arch x86_64" FFLAGS=”-arch x86_64" py27 setupscons.py scons
   2. LDFLAGS=”-arch x86_64″ FFLAGS=”-arch x86_64″ py27 setupscons.py
scons install

Scipy: ’0.8.0b1′

   1. LDFLAGS=”-arch x86_64″ FFLAGS=”-arch x86_64″ py27 setupscons.py scons
   2. LDFLAGS=”-arch x86_64″ FFLAGS=”-arch x86_64″ py27 setupscons.py
scons install

Vincent
>
> it seems to berelated to fftw libraries,
> i alsio tried to build libfftw from source using both archs flag :
>
> http://lists.apple.com/archives/xcode-users/2007/Apr/msg00127.html
>
> i used --arch i386 and --arch x86_64 (the same i used to build numpy)
>
>
> epy:scipy epy$ file /usr/local/lib/libfftw3f.a
> /usr/local/lib/libfftw3f.a: Mach-O universal binary with 2 architectures
> /usr/local/lib/libfftw3f.a (for architecture i386):     current ar archive random library
> /usr/local/lib/libfftw3f.a (for architecture x86_64):   current ar archive random library
> epy:scipy epy$
>
>
>
> then i rebuild scipy .. but the error persists
>
> (seems scipy uses some internal fftw .. or maybe the problem is not related to fftw ?)
>
> tring an updatedb and locate libfftw
> i can see that osx don't has any libfftw
> (locate found only libfftw i manually installed tring to fix the scipy issue)
>
>
> please i'm without any clue on how to go ahead,
>
> i'm available for any test or provide log to you
>
> thanks a lot !
>
> Massimo.
>
>
> Il giorno 13/ott/2010, alle ore 21.30, Matthew Brett ha scritto:
>
>> Hi,
>>
>>> the command :
>>>
>>> "git checkout farchs-from-c  "
>>>
>>> needs to be run inside the numpy directory ?
>>
>> Right - thanks for the correction:
>>
>>> there is the full log (chackout, build, test) :
>>>
>>> http://http.geofemengineering.it/epilog/numpy_log_test
>>
>> I think you meant http://www.geofemengineering.it/epilog/numpy_log_test ?
>>
>> You're getting errors like these:
>>
>> ======================================================================
>> ERROR: test_return_character.TestF90ReturnCharacter.test_all
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>  File "/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/case.py",
>> line 367, in setUp
>>    try_run(self.inst, ('setup', 'setUp'))
>>  File "/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/util.py",
>> line 491, in try_run
>>    return func()
>>  File "/Library/Python/2.6/site-packages/numpy/f2py/tests/util.py",
>> line 341, in setUp
>>    module_name=self.module_name)
>>  File "/Library/Python/2.6/site-packages/numpy/f2py/tests/util.py",
>> line 73, in wrapper
>>    memo[key] = func(*a, **kw)
>>  File "/Library/Python/2.6/site-packages/numpy/f2py/tests/util.py",
>> line 156, in build_code
>>    module_name=module_name)
>>  File "/Library/Python/2.6/site-packages/numpy/f2py/tests/util.py",
>> line 73, in wrapper
>>    memo[key] = func(*a, **kw)
>>  File "/Library/Python/2.6/site-packages/numpy/f2py/tests/util.py",
>> line 137, in build_module
>>    __import__(module_name)
>> ImportError: dlopen(/var/folders/1H/1HF3mbiVFOOWnbfLVKDmc++++TI/-Tmp-/tmp87fgzl/_test_ext_module_5403.so,
>> 2): no suitable image found.  Did find:
>>       /var/folders/1H/1HF3mbiVFOOWnbfLVKDmc++++TI/-Tmp-/tmp87fgzl/_test_ext_module_5403.so:
>> mach-o, but wrong architecture
>>
>>> seems fortran is broken again, i'm using the fortran that comes form the R research site (as suggested on the scipy site)
>>
>> I hope that someone who knows what they are doing can help you.
>>
>> If no-one offers, then see if you can extract the compilation flags
>> from the f2py build process somehow?
>>
>> Lacking experience of f2py, I ended up hacking the _installed_ version
>> of numpy/f2py/tests/utils.py around line 125 to add
>>
>> print 'build stdout: ', out
>>
>> to see what flags it was using.
>>
>> Best,
>>
>> Matthew
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>



-- 
Thanks
Vincent Davis
720-301-3003


More information about the SciPy-User mailing list