lyst / lyst/lightfm

Light FM throwing an installation error: AttributeError: 'dict' object has no attribute '__LIGHTFM_SETUP__'

Open
#687 8 comments 11 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5.1k
Forks
724
PR merge metrics
No merged PRs in 30d

Description

When installing lightFM as a Github action I am getting the following error.

```
pip install -r requirements.txt
[4](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:4)
shell: /usr/bin/bash -e {0}
[5](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:5)
env:
[6](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:6)
PREFECT_VERSION: 2.8.2
[7](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:7)
K8S_NAMESPACE: prefect
[8](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:8)
WORK_QUEUE: main
[9](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:9)
STAGING_BUCKET: endvr-prefect-storage-staging
[10](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:10)
STAGING_SNOWFLAKE_ACCOUNT: ama75210
[11](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:11)
PROD_BUCKET: endvr-prefect-storage-production
[12](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:12)
PROD_SNOWFLAKE_ACCOUNT: boa33536
[13](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:13)
DEPLOYMENT_ENV: Production
[14](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:14)
pythonLocation: /opt/hostedtoolcache/Python/3.10.11/x64
[15](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:15)
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.10.11/x64/lib/pkgconfig
[16](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:16)
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.11/x64
[17](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:17)
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.11/x64
[18](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:18)
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.11/x64
[19](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:19)
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.11/x64/lib
[20](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:20)
FLOW: streaming-recommendation-model
[21](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:22)
Collecting git+https://github.com/Endeavor-Digital/lightfm.git (from -r requirements.txt (line 5))
[22](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:23)
Cloning https://github.com/Endeavor-Digital/lightfm.git to /tmp/pip-req-build-rz1rrscb
[23](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:24)
Running command git clone --filter=blob:none --quiet https://github.com/Endeavor-Digital/lightfm.git /tmp/pip-req-build-rz1rrscb
[24](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:25)
Resolved https://github.com/Endeavor-Digital/lightfm.git to commit 2e2b2ac8841922ab4f593c6dc2e9addb5fc7eb6b
[25](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:26)
Installing build dependencies: started
[26](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:27)
Installing build dependencies: finished with status 'done'
[27](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:28)
Getting requirements to build wheel: started
[28](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:29)
Getting requirements to build wheel: finished with status 'error'
[29](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:30)
error: subprocess-exited-with-error
[30](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:31)

[31](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:32)
× Getting requirements to build wheel did not run successfully.
[32](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:33)
│ exit code: 1
[33](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:34)
╰─> [17 lines of output]
[34](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:35)
Traceback (most recent call last):
[35](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:36)
File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
[36](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:37)
main()
[37](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:38)
File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
[38](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:39)
json_out['return_val'] = hook(**hook_input['kwargs'])
[39](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:40)
File "/opt/hostedtoolcache/Python/3.10.11/x64/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
[40](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:41)
return hook(config_settings)
[41](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:42)
File "/tmp/pip-build-env-haxk8_c9/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
[42](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:43)
return self._get_build_requires(config_settings, requirements=['wheel'])
[43](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:44)
File "/tmp/pip-build-env-haxk8_c9/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
[44](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:45)
self.run_setup()
[45](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:46)
File "/tmp/pip-build-env-haxk8_c9/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 484, in run_setup
[46](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:47)
super(_BuildMetaLegacyBackend,
[47](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:48)
File "/tmp/pip-build-env-haxk8_c9/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
[48](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:49)
exec(code, locals())
[49](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:50)
File "", line 11, in
[50](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:51)
AttributeError: 'dict' object has no attribute '__LIGHTFM_SETUP__'
[51](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:52)
[end of output]
[52](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:53)

[53](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:54)
note: This error originates from a subprocess, and is likely not a problem with pip.
[54](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:55)
error: subprocess-exited-with-error
[55](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:56)

[56](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:57)
× Getting requirements to build wheel did not run successfully.
[57](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:58)
│ exit code: 1
[58](https://github.com/Endeavor-Digital/prefect-2-flows/actions/runs/4735271259/jobs/8405281638#step:6:59)
╰─> See above for output.
```

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at setup.py line 11 and compare its setup metadata handling with the workaround discussed in gensim issue 3362. Reproduce the failure with pip install -r requirements.txt under Python 3.10, then verify that installing the LightFM GitHub revision completes without the __LIGHTFM_SETUP__ AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.