I am trying to create an AWS lambda layer for cvxpy, following Rineesh Konaparthi's method. I run to error when run pip install cvxpy:
Building wheels for collected packages: scs
Building wheel for scs (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /home/ec2-user/.local/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpkotzc_4k
cwd: /tmp/pip-install-nh7lbi32/scs_2bbc38691e14434ebce20960b3331d42
Complete output (68 lines):
Namespace(blas64=False, extraverbose=False, float32=False, gpu=False, gpu_atrans=True, int32=False, scs=False)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/scs
copying src/__init__.py -> build/lib.linux-x86_64-3.7/scs
running build_ext
/tmp/pip-build-env-xmfc085b/overlay/lib64/python3.7/site-packages/numpy/distutils/system_info.py:690: UserWarning:
Optimized (vendor) Blas libraries are not found.
Falls back to netlib Blas library which has worse performance.
A better performance should be easily gained by switching
Blas library.
self.calc_info()
/tmp/pip-build-env-xmfc085b/overlay/lib64/python3.7/site-packages/numpy/distutils/system_info.py:690: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
self.calc_info()
/tmp/pip-build-env-xmfc085b/overlay/lib64/python3.7/site-packages/numpy/distutils/system_info.py:690: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
self.calc_info()
/tmp/pip-build-env-xmfc085b/overlay/lib64/python3.7/site-packages/numpy/distutils/system_info.py:1712: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
if getattr(self, '_calc_info_{}'.format(lapack))():
/tmp/pip-build-env-xmfc085b/overlay/lib64/python3.7/site-packages/numpy/distutils/system_info.py:1712: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
if getattr(self, '_calc_info_{}'.format(lapack))():
blas_mkl_info:
NOT AVAILABLE
blis_info:
NOT AVAILABLE
openblas_info:
libraries = ['openblas', 'openblas']
library_dirs = ['/usr/local/lib']
language = c
define_macros = [('HAVE_CBLAS', None)]
blas_opt_info:
libraries = ['openblas', 'openblas']
library_dirs = ['/usr/local/lib']
language = c
define_macros = [('HAVE_CBLAS', None)]
lapack_mkl_info:
NOT AVAILABLE
openblas_lapack_info:
libraries = ['openblas', 'openblas']
library_dirs = ['/usr/local/lib']
language = c
define_macros = [('HAVE_CBLAS', None)]
lapack_opt_info:
libraries = ['openblas', 'openblas']
library_dirs = ['/usr/local/lib']
language = c
define_macros = [('HAVE_CBLAS', None)]
{}
{}
error: Command "gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYTHON -DCTRLC=1 -DDLONG=1 -DCOPYAMATRIX -Iscs/include -Iscs/linsys -Iscs/linsys/cpu/direct/ -Iscs/linsys/external/amd -Iscs/linsys/external/dqlql -I/tmp/pip-build-env-xmfc085b/overlay/lib64/python3.7/site-packages/numpy/core/include -I/usr/include/python3.7m -c src/scsmodule.c -o build/temp.linux-x86_64-3.7/src/scsmodule.o -O3" failed with exit status 127
----------------------------------------
ERROR: **Failed building wheel for scs**
Failed to build scs
ERROR: Could not build wheels for scs which use PEP 517 and cannot be installed directly
Run pip install scs end with the same error. The following is the information of the Python and pip.
AMI: Amazon Linux2
Python 3.7.10
pip 21.2.4 from /home/ec2-user/.local/lib/python3.7/site-packages/pip (python 3.7)
Does anyone have any idea how to get it work or know an existing lambda layer that support cvxpy?