473,507 Members | 4,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to import extension module from embedding application on aix5

Hi,

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
and
make install

because I want to embed python in other language, so I continue run:
make libpython2.4.so
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>
int
main(int argc, char *argv[])
{
Py_Initialize();
PyRun_SimpleString("import time\n"
"print time.localtime()\n");
Py_Finalize();
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:
../importApp
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!

Xiaoning
Nov 1 '05 #1
0 1262

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
2459
by: Dan Perl | last post by:
Here is a python feature that I would like: to be able to import modules from an archive like the jar files in Java. Maybe a regular tar file? Maybe a python specific file type, let's call it a...
6
3052
by: gregory lielens | last post by:
Hello, I am currently writing python bindings to an existing C++ library, and I just encountered a problem that I hope has been solved by more experienced python programmers: A C++ class...
8
2750
by: Torsten Mohr | last post by:
Hi, i write an extension module in C at the moment. This module does some work on some own data types that consist of some values. The functions that can change the data are written in C. ...
1
1784
by: sven.nystrom | last post by:
I've re-built an extension module (as a .dll) using the 2.5a1 release. Unexpectedly, I'm not able to simply import it (not the way I can when building it for 2.3). Using imp.load_dynamic() the...
10
3743
by: Ben Finney | last post by:
Howdy all, Question: I have Python modules named without '.py' as the extension, and I'd like to be able to import them. How can I do that? Background: On Unix, I write programs intended to...
1
17189
by: alain MONTMORY | last post by:
Hello everybody, I am a newbie to python so I hope I am at the right place to expose my problem..... :-http://www.python.org/doc/2.4.2/ext/pure-embedding.html 5.3 Pure Embedding I download the...
6
2342
by: robert | last post by:
I get python crashes and (in better cases) strange Python exceptions when (in most cases) importing and using cookielib lazy on demand in a thread. It is mainly with cookielib, but remember the...
3
6844
by: Jim Hill | last post by:
Well, I've found about a hundred thousand web pages where people have had the same problem I have but nary a page with a solution that works for me. I want to do a simple embed, so I've followed...
5
2753
by: Gruik | last post by:
Hi people, I'm currently working on python embedding with C++. My goal is that the C++ part handle files writing/reading so that the Python part only works with buffers. I succeeded in buffer...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7023
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
410
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.