Cython dynamic library problem

Tommy Grav tgrav at mac.com
Thu Sep 18 16:47:30 CEST 2008


I am trying to learn how to use cython, and while I am following the  
cython-dev
mailing list I didn't feel like this question was totally appropriate  
for its audience
so I am trying here first.

I am on a max os x 10.5.4 running

drtgrav% python
ActivePython 2.5.2.2 (ActiveState Software Inc.) based on
Python 2.5.2 (r252:60911, Mar 27 2008, 17:40:23)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>>

I have a pure python file that I am wanting to try to speed up some,
so I ran the file through cython, compiled it with gcc and tried to
call it from a python file

 > cython integrations.pyx
 > gcc -arch ppc -shared -c -fPIC -I/usr/include/python2.5  
integration.c -o pyx_integration.so
 > python integration_test.py
Traceback (most recent call last):
   File "integration_test.py", line 1, in <module>
     from astroPyX import pyx_integration
ImportError: dlopen(/Users/drtgrav/Work/myCode/Python/astroPyX/ 
pyx_integration.so, 2): no suitable image found.  Did find:
	/Users/drtgrav/Work/myCode/Python/astroPyX/pyx_integration.so: can't  
map

where integration_test.py is

from astroPyX import pyx_integration

pyx_integration.test(0)
pyx_integration.test(100)

Does anyone know what the ImportError means and how to correct it?

Cheers
   Tommy



More information about the Python-list mailing list