py2app version mismatch while including a library built with Pyrex

View: New views
2 Messages — Rating Filter:   Alert me  

py2app version mismatch while including a library built with Pyrex

by Derrick Hendricks-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I haven't tried packaging an app on a Mac before, so I'm not sure what's going on.  I've got this program that I'm trying to package using my 10.5 Leopard machine.  It uses an external library that's created using Pyrex.

Here's the current setup of my machine.  I'm using the python 2.4 that I got from python.org and py2app.  In the Makefile I use to compile the library, I use python 2.4.  Now, when I run py2app to create the bundle, py2app completes successfully.  And, I am creating what is supposed to be a "standalone" version of the app.  When going back and running the app, the app runs just fine until it tries to access the library.  At that point, I get:

Fatal Python error: Interpreter not initialized (version mismatch?)


I have a .py program that I've run to check the library.  When run under python 2.4, it executes correctly and I have no problems.  So, I'm fairly confident that the library it's being created using python 2.4.  I've run the same program specifying the 2.5 that comes with Leopard and I get the exact same error as I do when running from the app.  So, what it looks like to me is that when the package tries to include the library, it's using the system python instead somehow.  This doesn't make sense.  I've put some debug code into the app, and when it starts up, it's using python 2.4 (presumably the one bundled in the app).

Any ideas what's happening and how I can solve this one?

Thanks

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: py2app version mismatch while including a library built with Pyrex

by Christopher Barker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Derrick Hendricks wrote:

> Here's the current setup of my machine.  I'm using the python 2.4 that I
> got from python.org <http://python.org> and py2app.  In the Makefile I
> use to compile the library, I use python 2.4.

This is probably the source of your problem -- you really want to use
distutils to compile your extensions -- it will get all this right, and
probably avoid your problem.

> I have a .py program that I've run to check the library.  When run under
> python 2.4, it executes correctly and I have no problems.  So, I'm
> fairly confident that the library it's being created using python 2.4.  

Well, somewhere in there you probably are somehow running py2app with a
different python that you're building your extension against.

How many version of python do you have installed? you might try cleaning
out any extras (build-from-tarball, macports, fink, etc...)

-Chris



--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@...
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig