question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`pip install lightfm` fails

See original GitHub issue

Thanks for opening an issue!

Please include as much detail as possible: what does your dataset look like, what hyperparameters you are using (and have you tried other ones?).

When including code snippets, make sure you use appropriate code formatting using backtics. Have a look at the markdown reference for details: https://guides.github.com/features/mastering-markdown/.

When running pip install lightfm, this long error is printed. I have Visual Studio Build Tools 2022 v17.2.1 installed, despite the error suggesting I don’t.

>pip install lightfm
Defaulting to user installation because normal site-packages is not writeable
Collecting lightfm
  Using cached lightfm-1.16.tar.gz (310 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in c:\users\haley\appdata\roaming\python\python37\site-packages (from lightfm) (1.20.3)
Requirement already satisfied: scipy>=0.17.0 in c:\users\haley\appdata\roaming\python\python37\site-packages (from lightfm) (1.7.3)
Requirement already satisfied: requests in c:\users\haley\appdata\roaming\python\python37\site-packages (from lightfm) (2.27.1)
Requirement already satisfied: scikit-learn in c:\users\haley\appdata\roaming\python\python37\site-packages (from lightfm) (1.0.2)
Requirement already satisfied: idna<4,>=2.5 in c:\users\haley\appdata\roaming\python\python37\site-packages (from requests->lightfm) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\haley\appdata\roaming\python\python37\site-packages (from requests->lightfm) (1.26.9)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\haley\appdata\roaming\python\python37\site-packages (from requests->lightfm) (2.0.12)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\haley\appdata\roaming\python\python37\site-packages (from requests->lightfm) (2022.5.18.1)
Requirement already satisfied: threadpoolctl>=2.0.0 in c:\users\haley\appdata\roaming\python\python37\site-packages (from scikit-learn->lightfm) (3.1.0)
Requirement already satisfied: joblib>=0.11 in c:\users\haley\appdata\roaming\python\python37\site-packages (from scikit-learn->lightfm) (1.1.0)
Building wheels for collected packages: lightfm
  Building wheel for lightfm (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [71 lines of output]
      Compiling without OpenMP support.
      C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\dist.py:726: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
        % (opt, underscore_opt)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win32-3.7
      creating build\lib.win32-3.7\lightfm
      copying lightfm\cross_validation.py -> build\lib.win32-3.7\lightfm
      copying lightfm\data.py -> build\lib.win32-3.7\lightfm
      copying lightfm\evaluation.py -> build\lib.win32-3.7\lightfm
      copying lightfm\lightfm.py -> build\lib.win32-3.7\lightfm
      copying lightfm\_lightfm_fast.py -> build\lib.win32-3.7\lightfm
      copying lightfm\__init__.py -> build\lib.win32-3.7\lightfm
      creating build\lib.win32-3.7\lightfm\datasets
      copying lightfm\datasets\movielens.py -> build\lib.win32-3.7\lightfm\datasets
      copying lightfm\datasets\stackexchange.py -> build\lib.win32-3.7\lightfm\datasets
      copying lightfm\datasets\_common.py -> build\lib.win32-3.7\lightfm\datasets
      copying lightfm\datasets\__init__.py -> build\lib.win32-3.7\lightfm\datasets
      copying lightfm\_lightfm_fast_no_openmp.c -> build\lib.win32-3.7\lightfm
      copying lightfm\_lightfm_fast_openmp.c -> build\lib.win32-3.7\lightfm
      running build_ext
      Traceback (most recent call last):
        File "<string>", line 36, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Haley\AppData\Local\Temp\pip-install-00gq7k31\lightfm_62fdbc4319ff44929fdef8b9f59e1c86\setup.py", line 184, in <module>
          ext_modules=define_extensions(use_openmp),
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\__init__.py", line 155, in setup
          return distutils.core.setup(**attrs)
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\core.py", line 148, in setup
          return run_commands(dist)
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
          dist.run_commands()
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\wheel\bdist_wheel.py", line 299, in run
          self.run_command('build')
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\command\build.py", line 135, in run
          self.run_command(cmd_name)
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
          cmd_obj.run()
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\command\build_ext.py", line 79, in run
          _build_ext.run(self)
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\command\build_ext.py", line 339, in run
          self.build_extensions()
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\command\build_ext.py", line 448, in build_extensions
          self._build_extensions_serial()
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\command\build_ext.py", line 473, in _build_extensions_serial
          self.build_extension(ext)
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\command\build_ext.py", line 202, in build_extension
          _build_ext.build_extension(self, ext)
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\command\build_ext.py", line 534, in build_extension
          depends=ext.depends)
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\_msvccompiler.py", line 327, in compile
          self.initialize()
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\_distutils\_msvccompiler.py", line 224, in initialize
          vc_env = _get_vc_env(plat_spec)
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\msvc.py", line 316, in msvc14_get_vc_env
          return _msvc14_get_vc_env(plat_spec)
        File "C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\msvc.py", line 271, in _msvc14_get_vc_env
          "Unable to find vcvarsall.bat"
      setuptools._distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [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
  error: subprocess-exited-with-error

  × python setup.py clean did not run successfully.
  │ exit code: 1
  ╰─> [5 lines of output]
      Compiling without OpenMP support.
      C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\dist.py:726: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
        % (opt, underscore_opt)
      running clean
      error: [WinError 2] The system cannot find the file specified
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed cleaning build dir for lightfm
Failed to build lightfm
Installing collected packages: lightfm
  Running setup.py install for lightfm ... error
  error: subprocess-exited-with-error

  × Running setup.py install for lightfm did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Compiling without OpenMP support.
      C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\dist.py:726: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
        % (opt, underscore_opt)
      running install
      C:\Users\Haley\AppData\Roaming\Python\Python37\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        setuptools.SetuptoolsDeprecationWarning,
      running build
      running build_py
      running build_ext
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

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

× Encountered error while trying to install package.
╰─> lightfm

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.```

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
jemardercommented, Oct 14, 2022

I got the same issue using Windows 10, pip and Python 3.10. I tested using Python 3.7 and conda: conda install -c conda-forge lightfm

That worked for me, though I know this doesn’t address the specific issue.

0reactions
yuzhaycommented, Aug 19, 2022

I am also facing this issue. Any solutions for it yet?

I think you need to run python setup.py cythonize to regenerate *.c files for python 3.10.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fails to install conda install lightfm · Issue #139 - GitHub
@maciejkula I tried pip install lightfm in a conda virtualenv but still fails the installation with the message: Failed building wheel for lightfm...
Read more >
python - install lightfm on windows - Stack Overflow
Install from pypi using pip: pip install lightfm . Everything should work out-of-the box on Linux, OSX using Homebrew Python, and Windows ...
Read more >
lightfm - PyPI
LightFM is a Python implementation of a number of popular recommendation algorithms for both implicit and explicit feedback, including efficient ...
Read more >
Welcome to LightFM's documentation!
Install from pypi using pip: pip install lightfm . Everything should work out-of-the box on Linux, OSX using Homebrew Python, and Windows using...
Read more >
subprocess-exited-with-erro | The search engine you control.
It seems the error comes from not being able to install wheel for lightfm. I have tried to: pip install wheel python setup.py...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found