Compiling Python extensions for different Python installation

J

John Ky

Hello:

I have a machine that already has Python 2.2 installed.
Since I do not have root access to the machine, I have
installed Python 2.3 from source to my own private
directory. I can use this fine. When I build my own
C module extension and try to run it from Python 2.3
however, I get this message:

/test-wrk/test_manager/commonlib.py:12: RuntimeWarning: Python C API version
mismatch for module elxml: This Python has API version 1012, module elxml
has version 1011.

Could this be because the compilation was made against
2.2 and run from 2.3? If so, is there a way to force
my module compilation against 2.3?

Thanks

-John
 
D

Daniel Dittmar

John said:
directory. I can use this fine. When I build my own
C module extension and try to run it from Python 2.3
however, I get this message:

/test-wrk/test_manager/commonlib.py:12: RuntimeWarning: Python C API
version mismatch for module elxml: This Python has API version 1012,
module elxml has version 1011.

Could this be because the compilation was made against
2.2 and run from 2.3? If so, is there a way to force
my module compilation against 2.3?

Just make sure that any include directives in your Makefile point to your
Python 2.3 include directory. It may be necessary to copy
Python-2.3/pyconfig.h to Python-2.3/Include/pyconfig.h.

Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top