[Pythonmac-SIG] P4Python, MySQLdb, or Python Extensions

Lyndsey Ferguson lyndsey.ferguson at gmail.com
Mon Nov 19 16:03:49 CET 2007


On Nov 16, 2007, at 9:10 AM, sparklight wrote:

>
>
> Lyndsey Ferguson wrote:
>>
>> On 10/9/07, Nehemiah Dacres <vivacarlie at gmail.com> wrote:
>>>
>>> .so, if im not mistaken is eather a linux shared library or not a  
>>> mac
>>> shared library (someone correct me if im wrong) try making sure the
>>> python
>>> version you chose is the one for mac.
>>
>> Thank you for the reply. I have removed older versions of Python  
>> and using
>> your link, installed Python 2.5 for the Macintosh.
>>
>> After which I tried to build and install with the same problem. But  
>> I have
>> solved it and will post it to the author and this list (in case  
>> someone
>> follows in my footsteps).
>>
>> In the setup.py for the Macintosh case, I had to add the
>> "extra_link_args=["-framework", "Carbon] to the setup call. This  
>> works and
>> I
>> was able to run it in python.
>>
>
> Lyndsey - I see your resolution to the -framework Carbon problem, I
> discovered that also.  But I'm still groping for the solution to the
> "Inappropriate file type for dynamic loading" problem.  My linker (gcc
> running under the Eclipse IDE) produces a .dylib by default, not  
> a .so, and
> if I simply rename the file, I get the same traceback you got.   
> Clearly
> .dylib is an Apple dynamic library format, and MacPython 2.4 is not  
> prepared
> to recognize it.  How did you resolve this?  Did going to Python 2.5
> suffice?

Hi Ken,

I used the setup.py "build" command to build the .so file directly.

I also tried to build the object directly using the Xcode IDE, but as  
you have found out .dylib is the default type. One can rename it and  
it will get loaded as such, but I couldn't figure out how to build  
a .so file that the Python environment could recognize.

Just use setup.py build and it will take care of it.

Lyndsey



More information about the Pythonmac-SIG mailing list