AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  Python Version - Python 3.7.12 - Unable to install psutil module due to gcc not found error

    Posted Thu August 03, 2023 03:58 PM

    Dear Experts,

    We are running python version 3.7.12. Currently we are trying to install the module "psutil". The installation fails with the below error.

    Could you please suggest how to install the psutil module and resolve the gcc issue. 

    It seems then  gcc rpm is installed..  But when I execute gcc --version. it says not found. 

    # gcc
    sh: gcc:  not found.

    # rpm -qa | grep -i gcc
    libgcc-8.3.0-1.ppc
    libgcc6-6.3.0-1.ppc

    Error Details:

    ------------------

      building 'psutil._psutil_aix' extension
      creating build/temp.aix-7.2-cpython-37
      creating build/temp.aix-7.2-cpython-37/psutil
      creating build/temp.aix-7.2-cpython-37/psutil/arch
      creating build/temp.aix-7.2-cpython-37/psutil/arch/aix
      gcc -maix64 -fPIC -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DAIX_GENUINE_CPLUSCPLUS -D_LINUX_SOURCE_COMPAT -Wl,-brtl -O2 -fPIC -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DAIX_GENUINE_CPLUSCPLUS -D_LINUX_SOURCE_COMPAT -Wl,-brtl -O2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=595 -DPSUTIL_AIX=1 -I/opt/freeware/include/python3.7m -c psutil/_psutil_aix.c -o build/temp.aix-7.2-cpython-37/psutil/_psutil_aix.o
      error: command 'gcc' failed: No such file or directory: 'gcc'
      ----------------------------------------
      ERROR: Failed building wheel for psutil
    Failed to build psutil
    ERROR: Could not build wheels for psutil which use PEP 517 and cannot be installed directly



    ------------------------------
    Satish Krishnamurthy
    ------------------------------



  • 2.  RE: Python Version - Python 3.7.12 - Unable to install psutil module due to gcc not found error

    Posted Thu August 03, 2023 11:46 PM

    Hi Team,

    We have fixed the gcc error by installing the below rpm binaries.  Now we are encountering another issue while installing the psutil module. 

    Could you suggest with your recommendations. 

    gcc-8.3.0-1.ppc
    gcc-cpp-8.3.0-1.ppc

    psutil error:

    ---------------

    Building wheels for collected packages: psutil
      Building wheel for psutil (pyproject.toml): started
      Building wheel for psutil (pyproject.toml): finished with status 'error'
      error: subprocess-exited-with-error

      Building wheel for psutil (pyproject.toml) did not run successfully.
      exit code: 1

      [47 lines of output]

    ..........

      running build_ext
      building 'psutil._psutil_aix' extension
      creating build/temp.aix-7.2-cpython-37
      creating build/temp.aix-7.2-cpython-37/psutil
      creating build/temp.aix-7.2-cpython-37/psutil/arch
      creating build/temp.aix-7.2-cpython-37/psutil/arch/aix
      gcc -maix64 -fPIC -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DAIX_GENUINE_CPLUSCPLUS -D_LINUX_SOURCE_COMPAT -Wl,-brtl -O2 -fPIC -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DAIX_GENUINE_CPLUSCPLUS -D_LINUX_SOURCE_COMPAT -Wl,-brtl -O2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=595 -DPSUTIL_AIX=1 -I/opt/freeware/include/python3.7m -c psutil/_psutil_aix.c -o build/temp.aix-7.2-cpython-37/psutil/_psutil_aix.o
      psutil/_psutil_aix.c:31:10: fatal error: Python.h: No such file or directory
       #include <Python.h>
                ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for psutil
    Failed to build psutil
    ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects



    ------------------------------
    Satish Krishnamurthy
    ------------------------------



  • 3.  RE: Python Version - Python 3.7.12 - Unable to install psutil module due to gcc not found error

    Posted Fri August 04, 2023 01:38 AM

    Do you have python3-devel rpm installed?
    If not, please install it. 



    ------------------------------
    RESHMA KUMAR
    ------------------------------



  • 4.  RE: Python Version - Python 3.7.12 - Unable to install psutil module due to gcc not found error

    Posted Fri August 04, 2023 02:00 AM

    Hi Reshma,

    It seems the rpm package python3-devel  is not installed.. We will try installing the rpm and share the updates.

    Thank you for the quick help. 

    Thanks



    ------------------------------
    Satish Krishnamurthy
    ------------------------------



  • 5.  RE: Python Version - Python 3.7.12 - Unable to install psutil module due to gcc not found error

    Posted Fri August 04, 2023 10:51 AM

    Hi Team,

    We installed the devel rpm but encountered a different issue now.. Could you advise if it is related any GCC error.  Also we are unable to find the latest GCC version under 8.3.0 (gcc-8.3.0-6) in AIX toolbox..   Could you suggest.. 

    Installed GCC rpms:

    -----------------------

    libgcc-8.3.0-1.ppc
    gcc-8.3.0-1.ppc
    gcc-cpp-8.3.0-1.ppc

    Error: 

    =======

      building 'psutil._psutil_aix' extension
      creating build/temp.aix-7.2-cpython-37
      creating build/temp.aix-7.2-cpython-37/psutil
      creating build/temp.aix-7.2-cpython-37/psutil/arch
      creating build/temp.aix-7.2-cpython-37/psutil/arch/aix
      gcc -maix64 -fPIC -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DAIX_GENUINE_CPLUSCPLUS -D_LINUX_SOURCE_COMPAT -Wl,-brtl -O2 -fPIC -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DAIX_GENUINE_CPLUSCPLUS -D_LINUX_SOURCE_COMPAT -Wl,-brtl -O2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=595 -DPSUTIL_AIX=1 -I/opt/freeware/include/python3.7m -c psutil/_psutil_aix.c -o build/temp.aix-7.2-cpython-37/psutil/_psutil_aix.o
      In file included from /usr/include/sys/resource.h:57,
                       from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.3.0/include-fixed/sys/wait.h:56,
                       from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.3.0/include-fixed/stdlib.h:391,
                       from /opt/freeware/include/python3.7m/Python.h:34,
                       from psutil/_psutil_aix.c:31:
      /usr/include/sys/time.h:110:16: error: redefinition of 'struct sigset_t'
       typedef struct sigset_t {
                      ^~~~~~~~
      In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.3.0/include-fixed/stdio.h:503,
                       from /opt/freeware/include/python3.7m/Python.h:25,
                       from psutil/_psutil_aix.c:31:
      /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.3.0/include-fixed/sys/types.h:345:16: note: originally defined here
       typedef struct sigset_t {
                      ^~~~~~~~
      In file included from /usr/include/sys/resource.h:57,
                       from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.3.0/include-fixed/sys/wait.h:56,
                       from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.3.0/include-fixed/stdlib.h:391,
                       from /opt/freeware/include/python3.7m/Python.h:34,
                       from psutil/_psutil_aix.c:31:
      /usr/include/sys/time.h:126:3: error: conflicting types for 'sigset_t'
       } sigset_t;
         ^~~~~~~~
      In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.3.0/include-fixed/stdio.h:503,
                       from /opt/freeware/include/python3.7m/Python.h:25,
                       from psutil/_psutil_aix.c:31:
      /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.3.0/include-fixed/sys/types.h:361:3: note: previous declaration of 'sigset_t' was here
       } sigset_t;
         ^~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for psutil
    Failed to build psutil
    ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects



    ------------------------------
    Satish Krishnamurthy
    ------------------------------



  • 6.  RE: Python Version - Python 3.7.12 - Unable to install psutil module due to gcc not found error

    Posted Mon August 07, 2023 12:54 AM

    Hi Sathish,

     

    Looks like you are using very old level of RPMs from AIX toolbox.

    You should update to newer versions of gcc and that should fix the problem.

    This problem has been fixed in newer version of gcc.

    https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.2/gcc8/?C=M;O=D

     

    Now default gcc on AIX is v10 and also default python is 3.9

     

    Thanks,

     

    Sanket Rathi

     






  • 7.  RE: Python Version - Python 3.7.12 - Unable to install psutil module due to gcc not found error

    Posted Mon August 07, 2023 06:09 AM

    Hi Sanket,

    Thank you for the recommendation. We will upgrade to Python 3.9

    Thanks



    ------------------------------
    Satish Krishnamurthy
    ------------------------------



  • 8.  RE: Python Version - Python 3.7.12 - Unable to install psutil module due to gcc not found error

    Posted Mon August 07, 2023 06:25 AM

    psutil 5.9.0 (rpm name is python3-psutil) is already available in AIX Toolbox. 



    ------------------------------
    Ayappan P
    ------------------------------



  • 9.  RE: Python Version - Python 3.7.12 - Unable to install psutil module due to gcc not found error

    Posted Mon August 07, 2023 11:37 AM

    HI Ayappan,

    Thank you very much. I will install the same. 



    ------------------------------
    Satish Krishnamurthy
    ------------------------------