'"cffi" dependencies module issue while installing "pysftp" module in python Oracle Solaris 11.4

We have tried to install "pysftp" module in Solaris 11.4 with python, I have used to install by using "pip" module in python 3.7 version solaris 11.4 os version. we are able to install other packages without any issue. while trying to install dependencies are failing to install.

# python -m pip install pysftp==0.2.9

*Collecting pysftp==0.2.9
  Using cached pysftp-0.2.9.tar.gz (25 kB)
  Preparing metadata (setup.py) ... done
Collecting paramiko>=1.17
  Using cached paramiko-2.10.2-py2.py3-none-any.whl (211 kB)
Collecting bcrypt>=3.1.3
  Using cached bcrypt-3.2.0.tar.gz (42 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [116 lines of output]
      Collecting setuptools>=40.8.0
        Using cached setuptools-60.9.3-py3-none-any.whl (1.1 MB)
      Collecting wheel
        Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
      Collecting cffi>=1.1
        Using cached cffi-1.15.0.tar.gz (484 kB)
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
      Collecting pycparser
        Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
      Building wheels for collected packages: cffi
        Building wheel for cffi (setup.py): started
        Building wheel for cffi (setup.py): finished with status 'error'
        error: subprocess-exited-with-error
        × python setup.py bdist_wheel did not run successfully.
        │ exit code: 1
        ╰─> [36 lines of output]
            running bdist_wheel
            running build
            running build_py
            creating build
            creating build/lib.solaris-2.11-sun4v.64bit-3.7
            creating build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/__init__.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/api.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/backend_ctypes.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/cffi_opcode.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/commontypes.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/cparser.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/error.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/ffiplatform.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/lock.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/model.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/pkgconfig.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/recompiler.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/setuptools_ext.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/vengine_cpy.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/vengine_gen.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/verifier.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/_cffi_include.h -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/parse_c_type.h -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/_embedding.h -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/_cffi_errors.h -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            running build_ext
            building '_cffi_backend' extension
            creating build/temp.solaris-2.11-sun4v.64bit-3.7
            creating build/temp.solaris-2.11-sun4v.64bit-3.7/c
            gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -m64 -O3 -mno-app-regs -ffile-prefix-map=..=. -O2 -fPIC -DPIC -O3 -D_REENTRANT -m64 -O3 -mno-app-regs -ffile-prefix-map=..=. -O2 -fPIC -DPIC -O3 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.solaris-2.11-sun4v.64bit-3.7/c/_cffi_backend.o
            c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
               15 | #include <ffi.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 cffi
        Running setup.py clean for cffi
      Failed to build cffi
      Installing collected packages: wheel, setuptools, pycparser, cffi
        Running setup.py install for cffi: started
        Running setup.py install for cffi: finished with status 'error'
        error: subprocess-exited-with-error
        × Running setup.py install for cffi did not run successfully.
        │ exit code: 1
        ╰─> [38 lines of output]
            running install
            /usr/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
              setuptools.SetuptoolsDeprecationWarning,
            running build
            running build_py
            creating build
            creating build/lib.solaris-2.11-sun4v.64bit-3.7
            creating build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/__init__.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/api.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/backend_ctypes.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/cffi_opcode.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/commontypes.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/cparser.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/error.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/ffiplatform.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/lock.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/model.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/pkgconfig.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/recompiler.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/setuptools_ext.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/vengine_cpy.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/vengine_gen.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/verifier.py -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/_cffi_include.h -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/parse_c_type.h -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/_embedding.h -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            copying cffi/_cffi_errors.h -> build/lib.solaris-2.11-sun4v.64bit-3.7/cffi
            running build_ext
            building '_cffi_backend' extension
            creating build/temp.solaris-2.11-sun4v.64bit-3.7
            creating build/temp.solaris-2.11-sun4v.64bit-3.7/c
            gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -m64 -O3 -mno-app-regs -ffile-prefix-map=..=. -O2 -fPIC -DPIC -O3 -D_REENTRANT -m64 -O3 -mno-app-regs -ffile-prefix-map=..=. -O2 -fPIC -DPIC -O3 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.solaris-2.11-sun4v.64bit-3.7/c/_cffi_backend.o
            c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
               15 | #include <ffi.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: legacy-install-failure
      × Encountered error while trying to install package.
      ╰─> cffi
      note: This is an issue with the package mentioned above, not pip.
      hint: See above for output from the failure.
      [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.*

Thanks in advance, plz help !!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source