By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,345 Members | 1,783 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,345 IT Pros & Developers. It's quick & easy.

how to import extension module from embedding application on aix5

P: n/a

I download and extract python-2.4.2 source code for unix, and then, build
and install it on aix5, the configure option I used is:
../configure --enable-shared --disable-ipv6 --prefix=/usr/python
then, I run:
make install

because I want to embed python in other language, so I continue run:
then,run make install again.

after works above, I start python, try:
import time
print time.localtime()

every thing is okay.

and then, I try a simple example: import.c
#include <Python.h>
main(int argc, char *argv[])
PyRun_SimpleString("import time\n"
"print time.localtime()\n");
return 0;

the Makefile is like:
cc_r -c -I. -o ./import.o import.c $(PYINC).
cc_r -o ./importApp ./import.o -brtl $(LIBPATH) -lpython2.4
where PYINC and LIBPATH are correct.

I got the importApp, I try to run it:
I got an error message:
ImportError: Exec format error

I test most of extension module which is in
<python_home>/lib/python2.4/lib-dynload, such as math, parser, I got the
same error.

It seems due to try to import extension module from embedding application.
Any thing wrong I did when I configure and make install python?

Thank you!

Nov 1 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.