AIX Open Source

 View Only
  • 1.  Unable to install numpy with default Python 3.9 installation on AIX 7.3

    Posted Tue April 23, 2024 10:00 AM

    I am using Python 3.9 out of the box from AIX 7.3 :
    [root@CUNIM01:/] # which python3
    /usr/bin/python3
    [root@CUNIM01:/] # ll /usr/bin/python3
    0 lrwxrwxrwx 1 root system 30 Dec 11 15:10 /usr/bin/python3 -> /usr/opt/python3/bin/python3.9
    [root@CUNIM01:/] # lslpp -w /usr/opt/python3/bin/python3.9
    File Fileset Type
    ----------------------------------------------------------------------------
    /usr/opt/python3/bin/python3.9 python3.9.base File
    [root@CUNIM01:/] # lslpp -l python3\*
    Fileset Level State Description
    ----------------------------------------------------------------------------
    Path: /usr/lib/objrepos
    python3.9.base 3.9.17.1 COMMITTED Python 3.9 64-bit binary
    distribution

    Path: /etc/objrepos
    python3.9.base 3.9.17.1 COMMITTED Python 3.9 64-bit binary
    distribution

    I've created a new virtual python environment :
    [root@CUMPBSV1:/dwhouse/python] # python3 -m venv $PWD
    [root@CUMPBSV1:/dwhouse/python] # . bin/activate
    (python) [root@CUMPBSV1:/dwhouse/python] # python --version
    Python 3.9.18

    When trying to install numpy, I have the following error :
    (python) [root@CUMPBSV1:/dwhouse/python] # python -m pip install --proxy=http://proxysrvd:3128 numpy
    Collecting numpy
    Using cached numpy-1.26.4.tar.gz (15.8 MB)
    Installing build dependencies ... error
    error: subprocess-exited-with-error

    pip subprocess to install build dependencies did not run successfully.
    exit code: 1

    [10 lines of output]
    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0xa00000001567fa0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/cython/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0xa000000015700d0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/cython/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0xa00000001570fd0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/cython/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0xa00000001570f10>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/cython/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0xa000000015a3310>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/cython/
    ERROR: Could not find a version that satisfies the requirement Cython<3.1,>=0.29.34 (from versions: none)
    ERROR: No matching distribution found for Cython<3.1,>=0.29.34

    [notice] A new release of pip is available: 23.3.1 -> 24.0
    [notice] To update, run: pip install --upgrade pip
    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error

    pip subprocess to install build dependencies did not run successfully.
    exit code: 1

    See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.

    [notice] A new release of pip is available: 23.3.1 -> 24.0
    [notice] To update, run: pip install --upgrade pip
    (python) [root@CUMPBSV1:/dwhouse/python] # python -m pip list --proxy=http://proxysrvd:3128 Cython
    Package Version
    ---------- -------
    pip 23.3.1
    setuptools 58.1.0

    [notice] A new release of pip is available: 23.3.1 -> 24.0
    [notice] To update, run: pip install --upgrade pip

    I installed both rpms python3-Cython and python3.9-Cython but the result is still the same.

    Do you have and idea on how to install the Cython dependency for numpy in my environment ?

    Regards,

    Marc Baguelin



    ------------------------------
    Marc Baguelin
    ------------------------------


  • 2.  RE: Unable to install numpy with default Python 3.9 installation on AIX 7.3

    Posted Wed April 24, 2024 01:24 AM

    Hi Marc,

    I see you are using /usr/bin/python. 

    Any reason to not use /opt/freeware/bin/python which is the tool box python that is built with gcc?

    I would recommend you use the toolbox python. If you have dnf installed, you should see /opt/freeware/bin/python3. 

    We have numpy 1.26.2 in the toolbox and you can install it using command "dnf install python3-numpy"

    If you wish to build and install numpy on your own (The latest version - 1.26.4) then here is how you can do it:-

    export CXX="g++ -pthread"
    export CXXFLAGS=-maix64
    export OBJECT_MODE=64
    export LDFLAGS=-maix64
    export CC="gcc -pthread"
    export CFLAGS=-maix64
    pip3.9 install numpy --root=$PWD/install_dir -v --ignore-installed

    I succeeded in doing so. 

    Successfully built numpy
    Installing collected packages: numpy
      Creating /numpy-1.26.4/install_dir/opt/freeware/bin
      changing mode of /numpy-1.26.4/install_dir/opt/freeware/bin/f2py to 755
      WARNING: The script f2py is installed in '/numpy-1.26.4/install_dir/opt/freeware/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    Successfully installed numpy-1.26.4

    Try it and let us know if something goes wrong or if it works. Please change the install directory in your command to wherever you want to. 



    ------------------------------
    Aditya Kamath
    ------------------------------



  • 3.  RE: Unable to install numpy with default Python 3.9 installation on AIX 7.3

    IBM Champion
    Posted Wed April 24, 2024 03:52 AM

    Hi Marc,

    first of all you have standard Python3 3.9.17 on AIX 7.3 but when you created virtual environment, you have Python3 3.9.18. It means you have another Python installation on your box and you use it instead of the standard AIX Python. It is not bad and I agree with Aditya, you shoud use /opt/freeware/bin/python3 for what you are doing. Otherwise you must have IBM XL C/C++ compiler on your box to compile numpy.

    The second and the most important problem with pip doesn't have anything to do with Python but with your environment. The error is "connection timed out" and as for me it is your proxy server (which definitely want to check for viruses in each downloaded file) the reason for the failure. Check with your network guys and the system administrator what they could do.



    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------



  • 4.  RE: Unable to install numpy with default Python 3.9 installation on AIX 7.3

    Posted Wed April 24, 2024 09:16 AM