No module named '_ctypes' during error build

Currently I am unable to deploy a python-flask app, it fails with the following error


    Selected Pip version (using ): 22.2.2

  Executing build process
    Installing Pip 22.2.2
failed to configure pip:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Looking in links: /tmp/pip-source3711551993
Processing /tmp/pip-source3711551993
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [100 lines of output]
      WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

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


            File "/tmp/pip-build-env-gujwwbmd/normal/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 26, in <module>
                from .macosx_libfile import calculate_macosx_platform_tag
              File "/tmp/pip-build-env-gujwwbmd/normal/lib/python3.10/site-packages/wheel/macosx_libfile.py", line 41, in <module>
                import ctypes
              File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/ctypes/__init__.py", line 8, in <module>
                from _ctypes import Union, Structure, Array
            ModuleNotFoundError: No module named '_ctypes'
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: metadata-generation-failed
      
      × Encountered error while generating package metadata.
      ╰─> See above for output.
      
      note: This is an issue with the package mentioned above, not pip.
      hint: See above for details.
      [end of output]

Please help me solve the issue