lightfm icon indicating copy to clipboard operation
lightfm copied to clipboard

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

Open aivansky-contractor opened this issue 1 year ago • 4 comments

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 <module>
[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 "<string>", line 11, in <module>
[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

aivansky-contractor avatar Apr 20 '23 17:04 aivansky-contractor

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.

ASH1998 avatar Apr 24 '23 10:04 ASH1998

+1 installing it under docker (linux/amd64 arch)

filipeo2-mck avatar Apr 25 '23 13:04 filipeo2-mck

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

xiaodong-xie avatar Apr 26 '23 19:04 xiaodong-xie