lyst / lightfm

A Python implementation of LightFM, a hybrid recommendation algorithm.
Apache License 2.0
4.66k stars 679 forks source link

Can't seem to install with with poetry 1.2.0 #660

Closed TNonet closed 1 year ago

TNonet commented 1 year ago

Installing lightfm on python 3.9 on M1 and Linux fails when using poetry 1.2.0

Configuration file exists at /Users/tnonet/Library/Application Support/pypoetry, reusing this directory.

Consider moving configuration to /Users/tnonet/Library/Preferences/pypoetry, as support for the legacy directory will be removed in an upcoming release.
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing lightfm (1.16): Failed

  CalledProcessError

  Command '['/Users/tnonet/Library/Caches/pypoetry/virtualenvs/python-kernel-om-AZX99-py3.9/bin/python', '/Users/tnonet/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/virtualenv/seed/wheels/embed/pip-22.2.2-py3-none-any.whl/pip', 'install', '--use-pep517', '--disable-pip-version-check', '--prefix', '/Users/tnonet/Library/Caches/pypoetry/virtualenvs/python-kernel-om-AZX99-py3.9', '--no-deps', '/Users/tnonet/Library/Caches/pypoetry/artifacts/60/78/b7/59b990f2bb6ac1f6c329401718b8a79b6d7b892470c5e61d6027043089/lightfm-1.16.tar.gz']' returned non-zero exit status 1.

  at /opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:528 in run
       524│             # We don't call process.wait() as .__exit__ does that for us.
       525│             raise
       526│         retcode = process.poll()
       527│         if check and retcode:
    →  528│             raise CalledProcessError(retcode, process.args,
       529│                                      output=stdout, stderr=stderr)
       530│     return CompletedProcess(process.args, retcode, stdout, stderr)
       531│
       532│

The following error occurred when trying to handle this error:

  EnvCommandError

  Command ['/Users/tnonet/Library/Caches/pypoetry/virtualenvs/python-kernel-om-AZX99-py3.9/bin/python', '/Users/tnonet/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/virtualenv/seed/wheels/embed/pip-22.2.2-py3-none-any.whl/pip', 'install', '--use-pep517', '--disable-pip-version-check', '--prefix', '/Users/tnonet/Library/Caches/pypoetry/virtualenvs/python-kernel-om-AZX99-py3.9', '--no-deps', '/Users/tnonet/Library/Caches/pypoetry/artifacts/60/78/b7/59b990f2bb6ac1f6c329401718b8a79b6d7b892470c5e61d6027043089/lightfm-1.16.tar.gz'] errored with the following return code 1, and output:
  Processing /Users/tnonet/Library/Caches/pypoetry/artifacts/60/78/b7/59b990f2bb6ac1f6c329401718b8a79b6d7b892470c5e61d6027043089/lightfm-1.16.tar.gz
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'error'
    error: subprocess-exited-with-error

    × Getting requirements to build wheel did not run successfully.
    │ exit code: 1
    ╰─> [17 lines of output]
        Traceback (most recent call last):
          File "/var/folders/60/9kbpc9q55tdcdhpdjkfs0h_80000gn/T/tmpd6oyuk0z_in_process.py", line 363, in <module>
            main()
          File "/var/folders/60/9kbpc9q55tdcdhpdjkfs0h_80000gn/T/tmpd6oyuk0z_in_process.py", line 345, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
          File "/var/folders/60/9kbpc9q55tdcdhpdjkfs0h_80000gn/T/tmpd6oyuk0z_in_process.py", line 130, in get_requires_for_build_wheel
            return hook(config_settings)
          File "/private/var/folders/60/9kbpc9q55tdcdhpdjkfs0h_80000gn/T/pip-build-env-o1giy_f_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
            return self._get_build_requires(config_settings, requirements=['wheel'])
          File "/private/var/folders/60/9kbpc9q55tdcdhpdjkfs0h_80000gn/T/pip-build-env-o1giy_f_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
            self.run_setup()
          File "/private/var/folders/60/9kbpc9q55tdcdhpdjkfs0h_80000gn/T/pip-build-env-o1giy_f_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 482, in run_setup
            super(_BuildMetaLegacyBackend,
          File "/private/var/folders/60/9kbpc9q55tdcdhpdjkfs0h_80000gn/T/pip-build-env-o1giy_f_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 335, in run_setup
            exec(code, locals())
          File "<string>", line 11, in <module>
        AttributeError: 'dict' object has no attribute '__LIGHTFM_SETUP__'
        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.

  at ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/utils/env.py:1473 in _run
      1469│                 output = subprocess.check_output(
      1470│                     command, stderr=subprocess.STDOUT, env=env, **kwargs
      1471│                 )
      1472│         except CalledProcessError as e:
    → 1473│             raise EnvCommandError(e, input=input_)
      1474│
      1475│         return decode(output)
      1476│
      1477│     def execute(self, bin: str, *args: str, **kwargs: Any) -> int:

The following error occurred when trying to handle this error:

  PoetryException

  Failed to install /Users/tnonet/Library/Caches/pypoetry/artifacts/60/78/b7/59b990f2bb6ac1f6c329401718b8a79b6d7b892470c5e61d6027043089/lightfm-1.16.tar.gz

  at ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/utils/pip.py:51 in pip_install
       47│
       48│     try:
       49│         return environment.run_pip(*args)
       50│     except EnvCommandError as e:
    →  51│         raise PoetryException(f"Failed to install {path.as_posix()}") from e
       52│
TNonet commented 1 year ago

Let me know if I should open this with poetry

dimbleby commented 1 year ago

https://github.com/python-poetry/poetry/issues/6527 (where the answer was: no, this is not a poetry bug)

dimbleby commented 1 year ago

I guess you want to import builtins and use that, rather than rely on the "implementation detail" that is __builtins__

https://docs.python.org/3/library/builtins.html

As an implementation detail, most modules have the name __builtins__ made available as part of their globals. The value of __builtins__ is normally either this module or the value of this module’s __dict__ attribute.

duong-le-mns commented 1 year ago

I hope this issue will be resolved soon. Adding my comment to show there's more interest in getting this resolved.

m-gris commented 1 year ago

I'm going to join @duong-le-mns in hoping that one the kind maintainers of lightfm will find the time to fix this issue 😀 🙏

duong-le-mns commented 1 year ago

Thanks @maciejkula @oliverholworthy for looking into this issue. I have tried to install the new version of Lightfm (1.17) with --use-pep517 but still face the same issue

unrepeat commented 1 year ago

same problem here with 1.17 AttributeError: 'dict' object has no attribute '__LIGHTFM_SETUP__'

TNonet commented 11 months ago

I believe this issue should be re-opened.

RILUCK commented 4 weeks ago

True anyone able to resolve it? @mattflo @FlorianWilhelm @maciejkula @daniel-ferguson