Issue 1:
export 'CC=gcc -lgcc'
export LDSHARED="/opt/freeware/lib64/python3.7/config-3.7m/ld_so_aix gcc -bI:/opt/freeware/lib64/python3.7/config-3.7m/python.exp"
export CFLAGS="-pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -fno-tree-dominator-opts"

# oslevel -s
6100-09-12-1837
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/lto-wrapper
Target: powerpc-ibm-aix6.1.0.0
Configured with: ../gcc-6.3.0/configure --prefix=/opt/freeware --mandir=/opt/freeware/man --infodir=/opt/freeware/info --with-local-prefix=/opt/freeware --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran,objc,obj-c++ --enable-version-specific-runtime-libs --disable-nls --enable-decimal-float=dpd --with-cloog=no --with-ppl=no --disable-libstdcxx-pch --enable-__cxa_atexit --host=powerpc-ibm-aix6.1.0.0
Thread model: aix
gcc version 6.3.0 (GCC)
# python -V
Python 3.7.4
# pip list
Package Version
---------- -------
Cython 0.29.16
numpy 1.16.0
pip 19.1
setuptools 40.8.0

# python3
Python 3.7.4 (default, Nov 7 2019, 21:34:34)
[GCC 6.3.0] on aix6
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
Traceback (most recent call last):
File "/opt/freeware/lib64/python3.7/site-packages/numpy-1.16.0-py3.7-aix-6.1.egg/numpy/core/__init__.py", line 16, in <module>
from . import multiarray
File "/opt/freeware/lib64/python3.7/site-packages/numpy-1.16.0-py3.7-aix-6.1.egg/numpy/core/multiarray.py", line 12, in <module>
from . import overrides
File "/opt/freeware/lib64/python3.7/site-packages/numpy-1.16.0-py3.7-aix-6.1.egg/numpy/core/overrides.py", line 9, in <module>
from numpy.core._multiarray_umath import add_docstring, ndarray
ImportError: 0509-022 Cannot load module /opt/freeware/lib64/python3.7/site-packages/numpy-1.16.0-py3.7-aix-6.1.egg/numpy/core/_multiarray_umath.so.
0509-026 System error: Cannot run a file that does not have a valid format.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/freeware/lib64/python3.7/site-packages/numpy-1.16.0-py3.7-aix-6.1.egg/numpy/__init__.py", line 142, in <module>
from . import core
File "/opt/freeware/lib64/python3.7/site-packages/numpy-1.16.0-py3.7-aix-6.1.egg/numpy/core/__init__.py", line 47, in <module>
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
1. Check that you are using the Python you expect (you're using /usr/bin/python3),
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy versions you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: 0509-022 Cannot load module /opt/freeware/lib64/python3.7/site-packages/numpy-1.16.0-py3.7-aix-6.1.egg/numpy/core/_multiarray_umath.so.
0509-026 System error: Cannot run a file that does not have a valid format.

Issue 2:
bash-5.0# gcc -v

Using built-in specs.

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/opt/freeware/libexec/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/lto-wrapper

Target: powerpc-ibm-aix6.1.0.0

Configured with: ../gcc-6.3.0/configure --prefix=/opt/freeware --mandir=/opt/freeware/man --infodir=/opt/freeware/info --with-local-prefix=/opt/freeware --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran,objc,obj-c++ --enable-version-specific-runtime-libs --disable-nls --enable-decimal-float=dpd --with-cloog=no --with-ppl=no --disable-libstdcxx-pch --enable-__cxa_atexit --host=powerpc-ibm-aix6.1.0.0

Thread model: aix

gcc version 6.3.0 (GCC)

bash-5.0# python -V

Python 3.6.6

bash-5.0# python

Python 3.6.6 (default, Jul 11 2018, 05:41:50)

[GCC 6.3.0] on aix6

Type "help", "copyright", "credits" or "license" for more information.

import numpy

Traceback (most recent call last):

File "/opt/freeware/lib64/python3.6/site-packages/numpy-1.16.0-py3.6-aix-6.1.egg/numpy/core/init.py", line 16, in

from . import multiarray

File "/opt/freeware/lib64/python3.6/site-packages/numpy-1.16.0-py3.6-aix-6.1.egg/numpy/core/multiarray.py", line 12, in

from . import overrides

File "/opt/freeware/lib64/python3.6/site-packages/numpy-1.16.0-py3.6-aix-6.1.egg/numpy/core/overrides.py", line 9, in

from numpy.core._multiarray_umath import add_docstring, ndarray

ImportError: 0509-022 Cannot load module /opt/freeware/lib64/python3.6/site-packages/numpy-1.16.0-py3.6-aix-6.1.egg/numpy/core/_multiarray_umath.so.

0509-026 System error: Cannot run a file that does not have a valid format.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "", line 1, in

File "/opt/freeware/lib64/python3.6/site-packages/numpy-1.16.0-py3.6-aix-6.1.egg/numpy/init.py", line 142, in

from . import core

File "/opt/freeware/lib64/python3.6/site-packages/numpy-1.16.0-py3.6-aix-6.1.egg/numpy/core/init.py", line 47, in

raise ImportError(msg)

ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the multiarray numpy extension module failed. Most

likely you are trying to import a failed build of numpy.

Here is how to proceed:

If you're working with a numpy git repository, try git clean -xdf

(removes all files not under version control) and rebuild numpy.

If you are simply trying to use the numpy version that you have installed:

your installation is broken - please reinstall numpy.

If you have already reinstalled and that did not fix the problem, then:

Check that you are using the Python you expect (you're using /usr/bin/python),

and that you have no directories in your PATH or PYTHONPATH that can

interfere with the Python and numpy versions you're trying to use.

If (1) looks fine, you can open a new issue at

https://github.com/numpy/numpy/issues. Please include details on:

how you installed Python

how you installed numpy

your operating system

whether or not you have multiple versions of Python installed

if you built from source, your compiler versions and ideally a build log

Note: this error has many possible causes, so please don't comment on

an existing issue about this - open a new one instead.

Original error was: 0509-022 Cannot load module /opt/freeware/lib64/python3.6/site-packages/numpy-1.16.0-py3.6-aix-6.1.egg/numpy/core/_multiarray_umath.so.

0509-026 System error: Cannot run a file that does not have a valid format.