Originally posted by: ahatch
Sanket,
The issue seems to be that /opt/freeware/lib/python3.5/config/ directory and its contents do not appear to be delivered with the python3 RPM. I worked around the issue by building and installing Python3.5.4 from source and then linking the installed directory out. But since the version of Python I built is 32bit, it builds cx_Oracle as 32 bit and it doesn't work. I'm going to have to rebuild and install the 64bit Python so I can get the "config" directory . . . of course unless there is an easier way. I'm not a developer so I don't pretend to know much about building from source.
Here are the details:
# oslevel -s
7100-04-04-1717
# yum list | grep python3
python3.ppc 3.5.2-3 @AIX_Toolbox
python3-devel.ppc 3.5.2-3 @AIX_Toolbox
python3-test.ppc 3.5.2-3 @AIX_Toolbox
python3-tools.ppc 3.5.2-3 @AIX_Toolbox
python3-docs.ppc 3.5.2-3 AIX_Toolbox
# pip install cx_Oracle --upgrade
Collecting cx_Oracle
Using cached cx_Oracle-6.1.tar.gz
Installing collected packages: cx-Oracle
Running setup.py install for cx-Oracle ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-12q9blx2/cx-Oracle/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-m657j926-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'cx_Oracle' extension
creating build
creating build/temp.aix-7.1-3.5
creating build/temp.aix-7.1-3.5/src
gcc -DNDEBUG -O2 -I/opt/freeware/include -I/opt/freeware/include/ncurses -Iodpi/include -Iodpi/src -I/opt/freeware/include/python3.5m -c src/cx_Oracle.c -o build/temp.aix-7.1-3.5/src/cx_Oracle.o -DBUILD_VERSION=6.1
In file included from src/SessionPool.c:153:0,
from src/cx_Oracle.c:264:
src/Connection.c: In function 'Connection_Init':
src/Connection.c:778:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
dpiCreateParams.externalHandle = (void*) externalHandle;
^
src/Connection.c: In function 'Connection_GetHandle':
src/Connection.c:1061:40: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
return PyLong_FromUnsignedLongLong((unsigned long long) handle);
^
creating build/lib.aix-7.1-3.5
/opt/freeware/lib/python3.5/config/ld_so_aix gcc -maix32 -pthread -bI:/opt/freeware/lib/python3.5/config/python.exp -L. -L/usr/include -L/opt/freeware/include -L/usr/lib/threads -L/opt/freeware/lib -L/usr/lib -L/opt/freeware/lib -L/opt/freeware/lib -I/opt/freeware/include -I/opt/freeware/include/ncurses build/temp.aix-7.1-3.5/src/cx_Oracle.o -o build/lib.aix-7.1-3.5/cx_Oracle.so
unable to execute '/opt/freeware/lib/python3.5/config/ld_so_aix': No such file or directory
error: command '/opt/freeware/lib/python3.5/config/ld_so_aix' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-12q9blx2/cx-Oracle/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-m657j926-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-12q9blx2/cx-Oracle/
# ll /opt/freeware/lib/python3.5/config/
ls: 0653-341 The file /opt/freeware/lib/python3.5/config/ does not exist.
# pip install cx_Oracle --upgrade
Collecting cx_Oracle
Using cached cx_Oracle-6.1.tar.gz
Installing collected packages: cx-Oracle
Running setup.py install for cx-Oracle ... done
Successfully installed cx-Oracle-6.1
# python3
Python 3.5.2 (default, Dec 1 2016, 02:07:23)
[GCC 4.8.5] on aix6
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: 0509-022 Cannot load module /opt/freeware/lib64/python3.5/site-packages/cx_Oracle.so.
0509-026 System error: Cannot run a file that does not have a valid format.
>>>
If there was a way to get he "config" directory included with the RPM, I think that would help a lot when building binary extensions.
Any guidance/help is appreciated.
Thanks.
Alan
#AIXOpenSource#AIX-Open-Source-Software