Power

 View Only

 Numpy and Pandas failing to import with lapack issue

Manish Anand's profile image
Manish Anand posted Thu January 30, 2025 05:06 AM

Hi Team,

We installed numpy and pandas on AIX 73 using pip on a Dev host where gcc and other required packages are installed which is working fine.

We took that .whl file and trying to use on other prod host where we cannot install compilers. As per my understanding, the whl package compiled on the Dev host should work on prod but its not working.

Installation was ok but getting the below error. Looks like it needs 'lapack' package which needs 'gcc' and we avoid installaing compilers on prod host. Can you plesae check and below error and advise how we can make it working please.

Python 3.9.17 (main, Jul  5 2023, 06:17:22)
[GCC 10.3.0] on aix
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "................................................./venv/lib64/python3.9/site-packages/numpy/__init__.py", line 181, in <module>
    from . import lib
  File ".............................................../venv/lib64/python3.9/site-packages/numpy/lib/__init__.py", line 23, in <module>
    from . import _index_tricks_impl
  File "..................................................../venv/lib64/python3.9/site-packages/numpy/lib/_index_tricks_impl.py", line 12, in <module>
    import numpy.matrixlib as matrixlib
  File "............................................./venv/lib64/python3.9/site-packages/numpy/matrixlib/__init__.py", line 4, in <module>
    from . import defmatrix
  File ".........................................../venv/lib64/python3.9/site-packages/numpy/matrixlib/defmatrix.py", line 12, in <module>
    from numpy.linalg import matrix_power
  File "....................................................../venv/lib64/python3.9/site-packages/numpy/linalg/__init__.py", line 88, in <module>
    from . import _linalg
  File "................................/venv/lib64/python3.9/site-packages/numpy/linalg/_linalg.py", line 39, in <module>
    from numpy.linalg import _umath_linalg
ImportError:    0509-022 Cannot load module ......................./venv/lib64/python3.9/site-packages/numpy/linalg/_umath_linalg.cpython-39.so.
        0509-150   Dependent module liblapack.a(liblapack.so.3) could not be loaded.
        0509-022 Cannot load module liblapack.a(liblapack.so.3).
        0509-026 System error: A file or directory in the path name does not exist.
>>> import pandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "................................................./venv/lib64/python3.9/site-packages/pandas/__init__.py", line 19, in <module>
    raise ImportError(
ImportError: Unable to import required dependencies:
numpy:  0509-022 Cannot load module ............................................/venv/lib64/python3.9/site-packages/numpy/linalg/_umath_linalg.cpython-39.so.
        0509-150   Dependent module liblapack.a(liblapack.so.3) could not be loaded.
        0509-022 Cannot load module liblapack.a(liblapack.so.3).
        0509-026 System error: A file or directory in the path name does not exist.
>>>

Please let me know how we can fix this without installing 'lapack' RPM. Or there is any other way to install and use .whl package where compilers are not needed.

Many Thanks.

Regards,

Manish Anand