NicolasHug / Surprise

A Python scikit for building and analyzing recommender systems
http://surpriselib.com
BSD 3-Clause "New" or "Revised" License
6.28k stars 1k forks source link

Couldn't install Surprise #470

Closed b856741 closed 2 months ago

b856741 commented 11 months ago

Description

When I tried to start and typed python setup.py install It shows:

Actual Results

e1 e2 e3

Does anyone encountered it before or could give me some advise?

Versions

windows 10 anaconda 2.2.0 python 3.11.0

carlosplanchon commented 8 months ago

I'm having the same problem.

guilhermeparreira commented 8 months ago

me too. In the end of READMe, there is a note from the developer saying that "I will only maintain the package, provide bugfixes, and perhaps sometimes perf improvements. I have less time to dedicate to it now, so I’m unable to consider new features"

NicolasHug commented 8 months ago

It's hard to help with so little info. What were the steps that were followed? Screenshots make it worse - it's much easier to copy/paste the output.

command cl.exe failed: None

Do you have a C compiler?

guilhermeparreira commented 8 months ago

I will output my try:

I am on ubuntu 22.04 and Python 3.10.6

(omnisales-ml) guilherme@FEL0987:~/omnisales-ml$ pipenv install scikit-surprise --use-pep517
Installing scikit-surprise...
Resolving scikit-surprise...
Installing...
⠇ Installing scikit-surprise...[31m[1mError: [0m An error occurred while installing [32mscikit-surprise[0m!
Error text: Collecting scikit-surprise
  Using cached scikit-surprise-1.1.3.tar.gz (771 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: joblib>=1.0.0 in /home/guilherme/.local/share/virtualenvs/omnisales-ml-0XALTDrq/lib/python3.10/site-packages (from scikit-surprise->-r /tmp/pipenv-ollucilx-requirements/pipenv-ctvhk2em-requirement.txt (line 1)) (1.3.2)
Requirement already satisfied: numpy>=1.17.3 in /home/guilherme/.local/share/virtualenvs/omnisales-ml-0XALTDrq/lib/python3.10/site-packages (from scikit-surprise->-r /tmp/pipenv-ollucilx-requirements/pipenv-ctvhk2em-requirement.txt (line 1)) (1.26.1)
Requirement already satisfied: scipy>=1.3.2 in /home/guilherme/.local/share/virtualenvs/omnisales-ml-0XALTDrq/lib/python3.10/site-packages (from scikit-surprise->-r /tmp/pipenv-ollucilx-requirements/pipenv-ctvhk2em-requirement.txt (line 1)) (1.11.3)
Building wheels for collected packages: scikit-surprise
  Building wheel for scikit-surprise (setup.py): started
  Building wheel for scikit-surprise (setup.py): finished with status 'error'
  Running setup.py clean for scikit-surprise
Failed to build scikit-surprise
Installing collected packages: scikit-surprise
  Running setup.py install for scikit-surprise: started
  Running setup.py install for scikit-surprise: finished with status 'error'

⠏ Installing scikit-surprise...[36m  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [69 lines of output]
      /tmp/pip-install-21tymp7p/scikit-surprise_6246a7473bc042deb78ee040b84b19e3/setup.py:65: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!

              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************

      !!
        dist.Distribution().fetch_build_eggs(["numpy>=1.17.3"])
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/__main__.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/utils.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/builtin_datasets.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/trainset.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/reader.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/accuracy.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/dataset.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/dump.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/__init__.py -> build/lib.linux-x86_64-cpython-310/surprise
      creating build/lib.linux-x86_64-cpython-310/surprise/model_selection
      copying surprise/model_selection/search.py -> build/lib.linux-x86_64-cpython-310/surprise/model_selection
      copying surprise/model_selection/validation.py -> build/lib.linux-x86_64-cpython-310/surprise/model_selection
      copying surprise/model_selection/split.py -> build/lib.linux-x86_64-cpython-310/surprise/model_selection
      copying surprise/model_selection/__init__.py -> build/lib.linux-x86_64-cpython-310/surprise/model_selection
      creating build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/baseline_only.py -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/knns.py -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/algo_base.py -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/predictions.py -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/__init__.py -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/random_pred.py -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      running egg_info
      writing scikit_surprise.egg-info/PKG-INFO
      writing dependency_links to scikit_surprise.egg-info/dependency_links.txt
      writing entry points to scikit_surprise.egg-info/entry_points.txt
      writing requirements to scikit_surprise.egg-info/requires.txt
      writing top-level names to scikit_surprise.egg-info/top_level.txt
      reading manifest file 'scikit_surprise.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE.md'
      writing manifest file 'scikit_surprise.egg-info/SOURCES.txt'
      copying surprise/similarities.c -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/similarities.pyx -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/prediction_algorithms/co_clustering.c -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/co_clustering.pyx -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/matrix_factorization.c -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/matrix_factorization.pyx -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/optimize_baselines.c -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/optimize_baselines.pyx -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/slope_one.c -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/slope_one.pyx -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      warning: build_py: byte-compiling is disabled, skipping.

      running build_ext
      building 'surprise.similarities' extension
      creating build/temp.linux-x86_64-cpython-310
      creating build/temp.linux-x86_64-cpython-310/surprise
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/guilherme/.local/share/virtualenvs/omnisales-ml-0XALTDrq/lib/python3.10/site-packages/numpy/core/include 
-I/home/guilherme/.local/share/virtualenvs/omnisales-ml-0XALTDrq/include -I/usr/include/python3.10 -c surprise/similarities.c -o build/temp.linux-x86_64-cpython-310/surprise/similarities.o
      surprise/similarities.c:28:10: fatal error: Python.h: No such file or directory
         28 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for scikit-surprise
  error: subprocess-exited-with-error

  × Running setup.py install for scikit-surprise did not run successfully.
  │ exit code: 1
  ╰─> [82 lines of output]
      /tmp/pip-install-21tymp7p/scikit-surprise_6246a7473bc042deb78ee040b84b19e3/setup.py:65: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!

              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************

      !!
        dist.Distribution().fetch_build_eggs(["numpy>=1.17.3"])
      running install
      /home/guilherme/.local/share/virtualenvs/omnisales-ml-0XALTDrq/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
      !!

              ********************************************************************************
              Please avoid running ``setup.py`` directly.
              Instead, use pypa/build, pypa/installer or other
              standards-based tools.

              See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
              ********************************************************************************

      !!
        self.initialize_options()
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/__main__.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/utils.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/builtin_datasets.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/trainset.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/reader.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/accuracy.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/dataset.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/dump.py -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/__init__.py -> build/lib.linux-x86_64-cpython-310/surprise
      creating build/lib.linux-x86_64-cpython-310/surprise/model_selection
      copying surprise/model_selection/search.py -> build/lib.linux-x86_64-cpython-310/surprise/model_selection
      copying surprise/model_selection/validation.py -> build/lib.linux-x86_64-cpython-310/surprise/model_selection
      copying surprise/model_selection/split.py -> build/lib.linux-x86_64-cpython-310/surprise/model_selection
      copying surprise/model_selection/__init__.py -> build/lib.linux-x86_64-cpython-310/surprise/model_selection
      creating build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/baseline_only.py -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/knns.py -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/algo_base.py -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/predictions.py -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/__init__.py -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/random_pred.py -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      running egg_info
      writing scikit_surprise.egg-info/PKG-INFO
      writing dependency_links to scikit_surprise.egg-info/dependency_links.txt
      writing entry points to scikit_surprise.egg-info/entry_points.txt
      writing requirements to scikit_surprise.egg-info/requires.txt
      writing top-level names to scikit_surprise.egg-info/top_level.txt
      reading manifest file 'scikit_surprise.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE.md'
      writing manifest file 'scikit_surprise.egg-info/SOURCES.txt'
      copying surprise/similarities.c -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/similarities.pyx -> build/lib.linux-x86_64-cpython-310/surprise
      copying surprise/prediction_algorithms/co_clustering.c -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/co_clustering.pyx -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/matrix_factorization.c -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/matrix_factorization.pyx -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/optimize_baselines.c -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/optimize_baselines.pyx -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/slope_one.c -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      copying surprise/prediction_algorithms/slope_one.pyx -> build/lib.linux-x86_64-cpython-310/surprise/prediction_algorithms
      warning: build_py: byte-compiling is disabled, skipping.

      running build_ext
      building 'surprise.similarities' extension
      creating build/temp.linux-x86_64-cpython-310
      creating build/temp.linux-x86_64-cpython-310/surprise
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/guilherme/.local/share/virtualenvs/omnisales-ml-0XALTDrq/lib/python3.10/site-packages/numpy/core/include 
-I/home/guilherme/.local/share/virtualenvs/omnisales-ml-0XALTDrq/include -I/usr/include/python3.10 -c surprise/similarities.c -o build/temp.linux-x86_64-cpython-310/surprise/similarities.o
      surprise/similarities.c:28:10: fatal error: Python.h: No such file or directory
         28 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

  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.
╰─> scikit-surprise

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
[0m
✘ Installation Failed
post2web commented 8 months ago

+1

NicolasHug commented 2 months ago

Hi all, thanks for the report. This should be fixed with the v1.1.4 that I just released today. I'll close this issue but please open another one if you are still experiencing installation issues.