This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: AIX 5.3 - GCC - Python 2.7 Shared Library Support - Fatal Python error: Interpreter not initialized (version mismatch?)
Type: compile error Stage:
Components: Build Versions: Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Anurag.Chourasia, barry, sable, skrah
Priority: normal Keywords:

Created on 2010-11-27 21:41 by Anurag.Chourasia, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg122561 - (view) Author: Anurag Chourasia (Anurag.Chourasia) Date: 2010-11-27 21:41
Python extensions build on AIX 5.3 with GCC 4.2 fails.

The configure command was as follows

./configure --enable-shared --disable-ipv6 --with-gcc=gcc CPPFLAGS="-I /opt/freeware/include -I /opt/freeware/include/readline -I /opt/freeware/include/ncurses" LDFLAGS="-L. -L/usr/local/lib"

The error during the make step was as follows

running build
running build_ext
ldd: /lib/libreadline.a: File is an archive.
building dbm using ndbm
INFO: Can't locate Tcl/Tk libs and/or headers
building '_struct' extension
creating build
creating build/temp.aix-5.3-2.7
creating build/temp.aix-5.3-2.7/u01
creating build/temp.aix-5.3-2.7/u01/home
creating build/temp.aix-5.3-2.7/u01/home/apli
creating build/temp.aix-5.3-2.7/u01/home/apli/wm
creating build/temp.aix-5.3-2.7/u01/home/apli/wm/GDD
creating build/temp.aix-5.3-2.7/u01/home/apli/wm/GDD/Python-2.7
creating build/temp.aix-5.3-2.7/u01/home/apli/wm/GDD/Python-2.7/Modules
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/opt/freeware/include -I/opt/freeware/include/readline -I/opt/freeware/include/ncurses -I/usr/local/include -I/u01/home/apli/wm/GDD/Python-2.7/Include -I/u01/home/apli/wm/GDD/Python-2.7 -c /u01/home/apli/wm/GDD/Python-2.7/Modules/_struct.c -o build/temp.aix-5.3-2.7/u01/home/apli/wm/GDD/Python-2.7/Modules/_struct.o
creating build/lib.aix-5.3-2.7
./Modules/ld_so_aix gcc -pthread -bI:Modules/python.exp -L. -L/usr/local/lib build/temp.aix-5.3-2.7/u01/home/apli/wm/GDD/Python-2.7/Modules/_struct.o -L. -L/usr/local/lib -lpython2.7 -o build/lib.aix-5.3-2.7/
Fatal Python error: Interpreter not initialized (version mismatch?)
make: 1254-059 The signal code from the last command is 6.

The file build/lib.aix-5.3-2.7/ is present after this error. 

The error seems to be in importing the module that was just built. Here is the error message from the python executable that was built.

root [zibal]% pwd
root [zibal]% which python
root [zibal]% python
Python 2.7 (r27:82500, Nov 27 2010, 18:33:21)
[GCC 4.2.4] on aix5
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
Fatal Python error: Interpreter not initialized (version mismatch?)
IOT/Abort trap(coredump)

This is also an error in Version 2.6.6

I don't have any other conflicting python library that might cause this.
msg122575 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-11-27 22:31
Anurag, could you check out #941346 and see if there is anything that
might help? I think this is AIX specific.
msg122624 - (view) Author: Anurag Chourasia (Anurag.Chourasia) Date: 2010-11-28 04:27
Hi Stefen,

I looked at and I believe it might help my case, but, the changes made against that issue  are not clear to me.

It appears that for Python 2.7, the changes were made in the following 5 files

2. Lib/distutils/command/
4. Modules/
5. Modules/ld_so_aix

The changes done in the file 5 are not clear to me....the source code that I downloaded from still does not contain those changes. I am not sure if the changes were accepted to be in the release version but if someone could send me the changes then I am willing to try those out on my AIX Machine in question and share the results.

Please guide.
msg122629 - (view) Author: Anurag Chourasia (Anurag.Chourasia) Date: 2010-11-28 04:49
Just received a message from Benjamin Peterson informing the release of 2.7.1. I will now download that tar ball and it should have sebastian's changes as well. I will update the results of my build process shortly.
msg123072 - (view) Author: Anurag Chourasia (Anurag.Chourasia) Date: 2010-12-02 13:55
Hi All,

Thanks again for all your support.

I can confirm that this works fine with the AIX Shared Library build support added in Python 2.7.1 (and 3.x which I have not tested but my tests with 2.7.1 were absolutely fine)
Date User Action Args
2022-04-11 14:57:09adminsetgithub: 54764
2010-12-02 13:55:18Anurag.Chourasiasetstatus: open -> closed
resolution: fixed
messages: + msg123072
2010-11-28 04:49:20Anurag.Chourasiasetmessages: + msg122629
2010-11-28 04:27:26Anurag.Chourasiasetmessages: + msg122624
2010-11-27 22:31:37skrahsetnosy: + sable
messages: + msg122575
2010-11-27 22:01:31pitrousetnosy: + barry, skrah
2010-11-27 21:43:49Anurag.Chourasiasettitle: Fatal Python error: Interpreter not initialized (version mismatch?) -> AIX 5.3 - GCC - Python 2.7 Shared Library Support - Fatal Python error: Interpreter not initialized (version mismatch?)
2010-11-27 21:41:47Anurag.Chourasiacreate