Open aivansky-contractor opened 1 year ago
I am also facing the same issue with running lightfm install with docker.
Python image : public.ecr.aws/lambda/python:3.9
lightfm==1.17
#9 10.28 × Getting requirements to build wheel did not run successfully.
#9 10.28 │ exit code: 1
#9 10.28 ╰─> [17 lines of output]
#9 10.28 Traceback (most recent call last):
#9 10.28 File "/var/lang/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
#9 10.28 main()
#9 10.28 File "/var/lang/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
#9 10.28 json_out['return_val'] = hook(**hook_input['kwargs'])
#9 10.28 File "/var/lang/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
#9 10.28 return hook(config_settings)
#9 10.28 File "/tmp/pip-build-env-u1wccerz/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
#9 10.28 return self._get_build_requires(config_settings, requirements=['wheel'])
#9 10.28 File "/tmp/pip-build-env-u1wccerz/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
#9 10.28 self.run_setup()
#9 10.28 File "/tmp/pip-build-env-u1wccerz/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 487, in run_setup
#9 10.28 super(_BuildMetaLegacyBackend,
#9 10.28 File "/tmp/pip-build-env-u1wccerz/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in run_setup
#9 10.28 exec(code, locals())
#9 10.28 File "<string>", line 11, in <module>
#9 10.28 AttributeError: 'dict' object has no attribute '__LIGHTFM_SETUP__'
#9 10.28 [end of output]
May be its time to move away from lightfm.
+1 installing it under docker (linux/amd64
arch)
Came across this issue, and worked around it by using this hack:
python -m pip install --upgrade pip setuptools wheel
python -m pip install --no-use-pep517 lightfm
pip install -r requirements.txt
Came across this issue, and worked around it by using this hack:
python -m pip install --upgrade pip setuptools wheel python -m pip install --no-use-pep517 lightfm pip install -r requirements.txt
Not working for me unfortunatly: `.... ^ /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here Py_DEPRECATED(3.12) uint64_t ma_version_tag; ^ /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/pyport.h:317:54: note: expanded from macro 'Py_DEPRECATED'
^
lightfm/_lightfm_fast_no_openmp.c:30261:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~ ^
lightfm/_lightfm_fast_no_openmp.c:30316:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~ ^
lightfm/_lightfm_fast_no_openmp.c:30457:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~ ^
lightfm/_lightfm_fast_no_openmp.c:30512:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~ ^
lightfm/_lightfm_fast_no_openmp.c:30691:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~ ^
lightfm/_lightfm_fast_no_openmp.c:30746:55: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)x)->ob_digit;
~~~~~~~~~~~~~~~~~~ ^
lightfm/_lightfm_fast_no_openmp.c:31097:47: error: no member named 'ob_digit' in 'struct _longobject'
const digit* digits = ((PyLongObject*)b)->ob_digit;
~~~~~~~~~~~~~~~~~~ ^
22 warnings and 10 errors generated.
error: command '/usr/bin/clang' 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 lightfm Running setup.py clean for lightfm Failed to build lightfm ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (lightfm) `
Came across this issue, and worked around it by using this hack:
python -m pip install --upgrade pip setuptools wheel python -m pip install --no-use-pep517 lightfm pip install -r requirements.txt
I found this helpful. First I run:
python -m pip install --upgrade pip setuptools wheel
And then I had to install Microsoft Visual C++ via link
Finally run:
pip install lightfm
I always facing the same issue while installing LightFM in lambda python 3.11 runtime but using python 3.10 runtime with the below Dockerfile solved the error for me
Dockerfile:
FROM public.ecr.aws/lambda/python:3.10
RUN yum install -y gcc gcc-c++ python3-devel lapack-devel blas-devel
# Install Python packages
RUN pip3 install psycopg2-binary --target "${LAMBDA_TASK_ROOT}"
RUN pip3 install redis --target "${LAMBDA_TASK_ROOT}"
RUN pip3 install numpy --target "${LAMBDA_TASK_ROOT}"
RUN pip3 install pandas --target "${LAMBDA_TASK_ROOT}"
RUN pip3 install requests --target "${LAMBDA_TASK_ROOT}"
RUN pip3 install polars --target "${LAMBDA_TASK_ROOT}"
RUN pip3 install lightfm --target "${LAMBDA_TASK_ROOT}"
COPY app.py .
CMD ["app.handler"]
When installing lightFM as a Github action I am getting the following error.
I think this is related to the line https://github.com/Endeavor-Digital/lightfm/blob/2e2b2ac8841922ab4f593c6dc2e9addb5fc7eb6b/setup.py#L11
I think we should use workaround suggested here https://github.com/RaRe-Technologies/gensim/issues/3362