Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Python 3.12 #473

Closed
kwasiewicz002 opened this issue Jan 17, 2024 · 10 comments
Closed

Compatibility with Python 3.12 #473

kwasiewicz002 opened this issue Jan 17, 2024 · 10 comments

Comments

@kwasiewicz002
Copy link

kwasiewicz002 commented Jan 17, 2024

Description

I wanted to move my codebase to python 3.12, but I can't do it due to the surprise apparently not being compatible with it. Is there any chance that it becomes compatible anytime soon?

Actual Results

image

Versions

python 3.12.1
linux 6.5.11
scikit-surprise 1.1.3

@Dragon1573
Copy link

Dragon1573 commented Feb 15, 2024

I meet the same problem. Details are as follows:

Environments
16:44:46 D:\...\Python 1ms pwsh> winget list Python
名称                   ID                 版本     源
----------------------------------------------------------
Python Launcher        Python.Launcher    > 3.12.0 winget
Python 3.12.2 (64-bit) Python.Python.3.12 3.12.2   winget

16:44:50 D:\...\Python 1.782s pwsh> python --version
Python 3.12.2

16:44:54 D:\...\Python 29ms pwsh> pipx --version
1.4.3

16:44:58 D:\...\Python 403ms pwsh> pdm --version
PDM, version 2.12.3

16:45:02 D:\...\Python 780ms pwsh> pdm list --tree numpy
numpy 1.26.4 [ required: !=1.24.0,>=1.20&&<2,>=1.21&&<2,>=1.26.0&&<2.0,>=1.20&&>=1.20&&>=1.26.0 ]

16:46:00 D:\...\Python 2ms pwsh> systeminfo.exe

OS 名称:          Microsoft Windows 11 专业版
OS 版本:          10.0.22635 暂缺 Build 22635
OS 制造商:        Microsoft Corporation
OS 配置:          独立工作站
OS 构建类型:      Multiprocessor Free
系统类型:         x64-based PC
处理器:           安装了 1 个处理器。
                  [01]: Intel64 Family 6 Model 140 Stepping 1 GenuineIntel ~2803 Mhz
Console Logs
16:27:15 D:\...\Python 3ms pwsh> pdm add -d scikit-surprise
Adding packages to dev dev-dependencies: scikit-surprise
🔒 Lock successful
Changes are written to pyproject.toml.
Synchronizing working set with resolved packages: 1 to add, 0 to update, 0 to remove

  ✖ Install scikit-surprise 1.1.3 failed
Retry failed jobs
  ✖ Install scikit-surprise 1.1.3 failed

ERRORS:
add scikit-surprise failed:
Traceback (most recent call last):
  File "D:\Applications\Python\cp312\Lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\installers\synchronizers.py", line 286, in install_candidate
    self.manager.install(can)
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\installers\manager.py", line 34, in install
    dist_info = installer(str(prepared.build()), self.environment, prepared.direct_url())
                              ^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\models\candidates.py", line 418, in build
    self.wheel = Path(builder.build(build_dir, metadata_directory=self._metadata_dir))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\builders\wheel.py", line 26, in build
    requires = self._hook.get_requires_for_build_wheel(config_settings)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pyproject_hooks\_impl.py", line 166, in get_requires_for_build_wheel
    return self._call_hook('get_requires_for_build_wheel', {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pyproject_hooks\_impl.py", line 311, in _call_hook
    self._subprocess_runner(
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\builders\base.py", line 261, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\builders\base.py", line 107, in log_subprocessor
    raise build_error(e) from None
pdm.exceptions.BuildError: Build backend raised error: Showing the last 10 lines of the build output:
                           ^^^^^^^^^^^^^^^
  File "C:\Users\DRAGON~1\AppData\Local\Temp\pdm-build-env-l9_oswgu-shared\Lib\site-packages\pkg_resources\__init__.py", line 1119, in best_match
    return self.obtain(req, installer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\DRAGON~1\AppData\Local\Temp\pdm-build-env-l9_oswgu-shared\Lib\site-packages\pkg_resources\__init__.py", line 1130, in obtain
    return installer(requirement) if installer else None
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\DRAGON~1\AppData\Local\Temp\pdm-build-env-l9_oswgu-shared\Lib\site-packages\setuptools\installer.py", line 103, in
_fetch_build_egg_no_warn
    raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['D:\\Repository\\Python\\.venv\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel',
'--no-deps', '-w', 'C:\\Users\\DRAGON~1\\AppData\\Local\\Temp\\tmpstvtm6iq', '--quiet', 'numpy>=1.17.3']' returned non-zero exit status 1.

See C:\Users\DRAGON~1\AppData\Local\Temp\pdm-install-ws8fxpxf.log for detailed debug log.
[InstallationError]: Some package operations are not complete yet
WARNING: Add '-v' to see the detailed traceback

Tip

See pdm-install-ws8fxpxf.log for more details.

@Dragon1573
Copy link

distutils.errors.DistutilsError: Command '['D:\\Repository\\Python\\.venv\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel',
'--no-deps', '-w', 'C:\\Users\\DRAGON~1\\AppData\\Local\\Temp\\tmpstvtm6iq', '--quiet', 'numpy>=1.17.3']' returned non-zero exit status 1.

According to this DistutilsError, it seems scikit-surprise is looking for numpy>=1.17.3. However, the current latest version of NumPy is v1.26.4.

I think there may be some "mis-configured" properties of scikit-surprise.

@William-Fernandes252
Copy link

I meet the same problem. Details are as follows:

Environments

16:44:46 D:\...\Python 1ms pwsh> winget list Python
名称                   ID                 版本     源
----------------------------------------------------------
Python Launcher        Python.Launcher    > 3.12.0 winget
Python 3.12.2 (64-bit) Python.Python.3.12 3.12.2   winget

16:44:50 D:\...\Python 1.782s pwsh> python --version
Python 3.12.2

16:44:54 D:\...\Python 29ms pwsh> pipx --version
1.4.3

16:44:58 D:\...\Python 403ms pwsh> pdm --version
PDM, version 2.12.3

16:45:02 D:\...\Python 780ms pwsh> pdm list --tree numpy
numpy 1.26.4 [ required: !=1.24.0,>=1.20&&<2,>=1.21&&<2,>=1.26.0&&<2.0,>=1.20&&>=1.20&&>=1.26.0 ]

16:46:00 D:\...\Python 2ms pwsh> systeminfo.exe

OS 名称:          Microsoft Windows 11 专业版
OS 版本:          10.0.22635 暂缺 Build 22635
OS 制造商:        Microsoft Corporation
OS 配置:          独立工作站
OS 构建类型:      Multiprocessor Free
系统类型:         x64-based PC
处理器:           安装了 1 个处理器。
                  [01]: Intel64 Family 6 Model 140 Stepping 1 GenuineIntel ~2803 Mhz

Console Logs

16:27:15 D:\...\Python 3ms pwsh> pdm add -d scikit-surprise
Adding packages to dev dev-dependencies: scikit-surprise
🔒 Lock successful
Changes are written to pyproject.toml.
Synchronizing working set with resolved packages: 1 to add, 0 to update, 0 to remove

  ✖ Install scikit-surprise 1.1.3 failed
Retry failed jobs
  ✖ Install scikit-surprise 1.1.3 failed

ERRORS:
add scikit-surprise failed:
Traceback (most recent call last):
  File "D:\Applications\Python\cp312\Lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\installers\synchronizers.py", line 286, in install_candidate
    self.manager.install(can)
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\installers\manager.py", line 34, in install
    dist_info = installer(str(prepared.build()), self.environment, prepared.direct_url())
                              ^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\models\candidates.py", line 418, in build
    self.wheel = Path(builder.build(build_dir, metadata_directory=self._metadata_dir))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\builders\wheel.py", line 26, in build
    requires = self._hook.get_requires_for_build_wheel(config_settings)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pyproject_hooks\_impl.py", line 166, in get_requires_for_build_wheel
    return self._call_hook('get_requires_for_build_wheel', {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pyproject_hooks\_impl.py", line 311, in _call_hook
    self._subprocess_runner(
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\builders\base.py", line 261, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\builders\base.py", line 107, in log_subprocessor
    raise build_error(e) from None
pdm.exceptions.BuildError: Build backend raised error: Showing the last 10 lines of the build output:
                           ^^^^^^^^^^^^^^^
  File "C:\Users\DRAGON~1\AppData\Local\Temp\pdm-build-env-l9_oswgu-shared\Lib\site-packages\pkg_resources\__init__.py", line 1119, in best_match
    return self.obtain(req, installer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\DRAGON~1\AppData\Local\Temp\pdm-build-env-l9_oswgu-shared\Lib\site-packages\pkg_resources\__init__.py", line 1130, in obtain
    return installer(requirement) if installer else None
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\DRAGON~1\AppData\Local\Temp\pdm-build-env-l9_oswgu-shared\Lib\site-packages\setuptools\installer.py", line 103, in
_fetch_build_egg_no_warn
    raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['D:\\Repository\\Python\\.venv\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel',
'--no-deps', '-w', 'C:\\Users\\DRAGON~1\\AppData\\Local\\Temp\\tmpstvtm6iq', '--quiet', 'numpy>=1.17.3']' returned non-zero exit status 1.

See C:\Users\DRAGON~1\AppData\Local\Temp\pdm-install-ws8fxpxf.log for detailed debug log.
[InstallationError]: Some package operations are not complete yet
WARNING: Add '-v' to see the detailed traceback

Tip

See pdm-install-ws8fxpxf.log for more details.

Do you managed to solve this? I tried to install Surprise using Poetry but I got similar errors. I assumed that on PDM it would fail as well, as both expects the PEP 517 (I guess...).

@Dragon1573
Copy link

Dragon1573 commented Feb 21, 2024

Nope ... I can't solve it on my own. 😞

Installing scikit-surprise in Python v3.12.2 will get different outputs with/without PEP 517.

PEP 517 disabled
21:03:48 D:\Repository 2ms pwsh> python -m venv .venv

21:03:58 D:\Repository 6.797s pwsh> .\.venv\Scripts\activate.ps1

21:04:05 (Repository) D:\Repository 43ms pwsh> python -m pip install -U pip setuptools wheel
Looking in indexes: https://mirrors.bfsu.edu.cn/pypi/web/simple
Requirement already satisfied: pip in d:\repository\.venv\lib\site-packages (24.0)
Collecting setuptools
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/55/3a/5121b58b578a598b269537e09a316ad2a94fdd561a2c6eb75cd68578cc6b/setuptools-69.0.3-py3-none-any.whl (819 kB)
Collecting wheel
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/c7/c3/55076fc728723ef927521abaa1955213d094933dc36d4a2008d5101e1af5/wheel-0.42.0-py3-none-any.whl (65 kB)
Installing collected packages: wheel, setuptools
Successfully installed setuptools-69.0.3 wheel-0.42.0

21:04:19 (Repository) D:\Repository 3.778s pwsh> python -m pip install -U scikit-surprise
Looking in indexes: https://mirrors.bfsu.edu.cn/pypi/web/simple
Collecting scikit-surprise
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/30/e1/f4f78b7dd32feaa6256f000668a6932e81b899d0e5a5f84ab3fd1f5e2743/scikit-surprise-1.1.3.tar.gz (771 kB)
  Preparing metadata (setup.py) ... done
Collecting joblib>=1.0.0 (from scikit-surprise)
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/10/40/d551139c85db202f1f384ba8bcf96aca2f329440a844f924c8a0040b6d02/joblib-1.3.2-py3-none-any.whl (302 kB)
Collecting numpy>=1.17.3 (from scikit-surprise)
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/16/2e/86f24451c2d530c88daf997cb8d6ac622c1d40d19f5a031ed68a4b73a374/numpy-1.26.4-cp312-cp312-win_amd64.whl (15.5 MB)
Collecting scipy>=1.3.2 (from scikit-surprise)
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/f3/31/91a2a3c5eb85d2bfa86d7c98f2df5d77dcdefb3d80ca9f9037ad04393acf/scipy-1.12.0-cp312-cp312-win_amd64.whl (45.8 MB)
Building wheels for collected packages: scikit-surprise
  Building wheel for scikit-surprise (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [129 lines of output]
      C:\Users\Dragon1573\AppData\Local\Temp\pip-install-0ixc9q_a\scikit-surprise_c4422c8150a04d30ab7a4c3aefe7eaec\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.win-amd64-cpython-312
      creating build\lib.win-amd64-cpython-312\surprise
      copying surprise\accuracy.py -> build\lib.win-amd64-cpython-312\surprise
      copying surprise\builtin_datasets.py -> build\lib.win-amd64-cpython-312\surprise
      copying surprise\dataset.py -> build\lib.win-amd64-cpython-312\surprise
      copying surprise\dump.py -> build\lib.win-amd64-cpython-312\surprise
      copying surprise\reader.py -> build\lib.win-amd64-cpython-312\surprise
      copying surprise\trainset.py -> build\lib.win-amd64-cpython-312\surprise
      copying surprise\utils.py -> build\lib.win-amd64-cpython-312\surprise
      copying surprise\__init__.py -> build\lib.win-amd64-cpython-312\surprise
      copying surprise\__main__.py -> build\lib.win-amd64-cpython-312\surprise
      creating build\lib.win-amd64-cpython-312\surprise\model_selection
      copying surprise\model_selection\search.py -> build\lib.win-amd64-cpython-312\surprise\model_selection
      copying surprise\model_selection\split.py -> build\lib.win-amd64-cpython-312\surprise\model_selection
      copying surprise\model_selection\validation.py -> build\lib.win-amd64-cpython-312\surprise\model_selection
      copying surprise\model_selection\__init__.py -> build\lib.win-amd64-cpython-312\surprise\model_selection
      creating build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      copying surprise\prediction_algorithms\algo_base.py -> build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      copying surprise\prediction_algorithms\baseline_only.py -> build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      copying surprise\prediction_algorithms\knns.py -> build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      copying surprise\prediction_algorithms\predictions.py -> build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      copying surprise\prediction_algorithms\random_pred.py -> build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      copying surprise\prediction_algorithms\__init__.py -> build\lib.win-amd64-cpython-312\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'
      D:\Repository\.venv\Lib\site-packages\setuptools\command\build_py.py:207: _Warning: Package 'surprise.prediction_algorithms' is absent from the `packages` configuration.
      !!

              ********************************************************************************
              ############################
              # Package would be ignored #
              ############################
              Python recognizes 'surprise.prediction_algorithms' as an importable package[^1],
              but it is absent from setuptools' `packages` configuration.

              This leads to an ambiguous overall configuration. If you want to distribute this
              package, please make sure that 'surprise.prediction_algorithms' is explicitly added
              to the `packages` configuration field.

              Alternatively, you can also rely on setuptools' discovery methods
              (for example by using `find_namespace_packages(...)`/`find_namespace:`
              instead of `find_packages(...)`/`find:`).

              You can read more about "package discovery" on setuptools documentation page:

              - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

              If you don't want 'surprise.prediction_algorithms' to be distributed and are
              already explicitly excluding 'surprise.prediction_algorithms' via
              `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
              you can try to use `exclude_package_data`, or `include-package-data=False` in
              combination with a more fine grained `package-data` configuration.

              You can read more about "package data files" on setuptools documentation page:

              - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


              [^1]: For Python, any directory (with suitable naming) can be imported,
                    even if it does not contain any `.py` files.
                    On the other hand, currently there is no concept of package data
                    directory, all directories are treated like packages.
              ********************************************************************************

      !!
        check.warn(importable)
      copying surprise\similarities.c -> build\lib.win-amd64-cpython-312\surprise
      copying surprise\similarities.pyx -> build\lib.win-amd64-cpython-312\surprise
      copying surprise\prediction_algorithms\co_clustering.c -> build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      copying surprise\prediction_algorithms\matrix_factorization.c -> build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      copying surprise\prediction_algorithms\optimize_baselines.c -> build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      copying surprise\prediction_algorithms\slope_one.c -> build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      copying surprise\prediction_algorithms\co_clustering.pyx -> build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      copying surprise\prediction_algorithms\matrix_factorization.pyx -> build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      copying surprise\prediction_algorithms\optimize_baselines.pyx -> build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      copying surprise\prediction_algorithms\slope_one.pyx -> build\lib.win-amd64-cpython-312\surprise\prediction_algorithms
      running build_ext
      building 'surprise.similarities' extension
      creating build\temp.win-amd64-cpython-312
      creating build\temp.win-amd64-cpython-312\Release
      creating build\temp.win-amd64-cpython-312\Release\surprise
      D:\Applications\Microsoft\VSIDE\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ic:\users\dragon1573\appdata\local\temp\pip-install-0ixc9q_a\scikit-surprise_c4422c8150a04d30ab7a4c3aefe7eaec\.eggs\numpy-1.26.4-py3.12-win-amd64.egg\numpy\core\include -ID:\Repository\.venv\include -ID:\Applications\Python\cp312\include -ID:\Applications\Python\cp312\Include -ID:\Applications\Microsoft\VSIDE\BuildTools\VC\Tools\MSVC\14.37.32822\include -ID:\Applications\Microsoft\VSIDE\BuildTools\VC\Tools\MSVC\14.37.32822\ATLMFC\include -ID:\Applications\Microsoft\VSIDE\BuildTools\VC\Auxiliary\VS\include "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" -ID:\Applications\Microsoft\VSIDE\BuildTools\VC\Tools\MSVC\14.37.32822\include -ID:\Applications\Microsoft\VSIDE\BuildTools\VC\Tools\MSVC\14.37.32822\ATLMFC\include -ID:\Applications\Microsoft\VSIDE\BuildTools\VC\Auxiliary\VS\include "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" /Tcsurprise/similarities.c /Fobuild\temp.win-amd64-cpython-312\Release\surprise/similarities.obj
      similarities.c
      c:\users\dragon1573\appdata\local\temp\pip-install-0ixc9q_a\scikit-surprise_c4422c8150a04d30ab7a4c3aefe7eaec\.eggs\numpy-1.26.4-py3.12-win-amd64.egg\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
      surprise/similarities.c(15478): warning C4996: 'Py_OptimizeFlag': deprecated in 3.12
      surprise/similarities.c(24414): error C2039: "curexc_traceback": 不是 "_ts" 的成员
      D:\Applications\Python\cp312\include\cpython/pystate.h(115): note: 参见“_ts”的声明
      surprise/similarities.c(24417): error C2039: "curexc_traceback": 不是 "_ts" 的成员
      D:\Applications\Python\cp312\include\cpython/pystate.h(115): note: 参见“_ts”的声明
      surprise/similarities.c(24531): warning C4013: “_PyUnicode_Ready”未定义;假设外部返回 int
      surprise/similarities.c(25020): error C2039: "ob_digit": 不是 "_longobject" 的成员
      D:\Applications\Python\cp312\include\cpython/longintrepr.h(87): note: 参见“_longobject”的声明
      surprise/similarities.c(26982): error C2039: "ob_digit": 不是 "_longobject" 的成员
      D:\Applications\Python\cp312\include\cpython/longintrepr.h(87): note: 参见“_longobject”的声明
      surprise/similarities.c(27037): error C2039: "ob_digit": 不是 "_longobject" 的成员
      D:\Applications\Python\cp312\include\cpython/longintrepr.h(87): note: 参见“_longobject”的声明
      surprise/similarities.c(27254): error C2039: "ob_digit": 不是 "_longobject" 的成员
      D:\Applications\Python\cp312\include\cpython/longintrepr.h(87): note: 参见“_longobject”的声明
      surprise/similarities.c(27309): error C2039: "ob_digit": 不是 "_longobject" 的成员
      D:\Applications\Python\cp312\include\cpython/longintrepr.h(87): note: 参见“_longobject”的声明
      surprise/similarities.c(27450): error C2039: "ob_digit": 不是 "_longobject" 的成员
      D:\Applications\Python\cp312\include\cpython/longintrepr.h(87): note: 参见“_longobject”的声明
      surprise/similarities.c(27505): error C2039: "ob_digit": 不是 "_longobject" 的成员
      D:\Applications\Python\cp312\include\cpython/longintrepr.h(87): note: 参见“_longobject”的声明
      surprise/similarities.c(27856): error C2039: "ob_digit": 不是 "_longobject" 的成员
      D:\Applications\Python\cp312\include\cpython/longintrepr.h(87): note: 参见“_longobject”的声明
      error: command 'D:\\Applications\\Microsoft\\VSIDE\\BuildTools\\VC\\Tools\\MSVC\\14.37.32822\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for scikit-surprise
  Running setup.py clean for scikit-surprise
Failed to build scikit-surprise
ERROR: Could not build wheels for scikit-surprise, which is required to install pyproject.toml-based projects
PEP 517 enabled
21:05:08 (Repository) D:\Repository 176ms pwsh> python -m pip install -U --use-pep517 scikit-surprise
Looking in indexes: https://mirrors.bfsu.edu.cn/pypi/web/simple
Collecting scikit-surprise
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/30/e1/f4f78b7dd32feaa6256f000668a6932e81b899d0e5a5f84ab3fd1f5e2743/scikit-surprise-1.1.3.tar.gz (771 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [60 lines of output]
      <string>: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`.
              ********************************************************************************

      !!
      WARNING: The wheel package is not available.
      D:\Repository\.venv\Scripts\python.exe: No module named pip
      Traceback (most recent call last):
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-5u2qo23r\overlay\Lib\site-packages\setuptools\installer.py", line 101, in _fetch_build_egg_no_warn
          subprocess.check_call(cmd)
        File "D:\Applications\Python\cp312\Lib\subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['D:\\Repository\\.venv\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\DRAGON~1\\AppData\\Local\\Temp\\tmpvtocohq7', '--quiet', 'numpy>=1.17.3']' returned non-zero exit status 1.

      The above exception was the direct cause of the following exception:

      Traceback (most recent call last):
        File "D:\Repository\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "D:\Repository\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "D:\Repository\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-5u2qo23r\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-5u2qo23r\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-5u2qo23r\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-5u2qo23r\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 65, in <module>
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-5u2qo23r\overlay\Lib\site-packages\setuptools\dist.py", line 636, in fetch_build_eggs
          return _fetch_build_eggs(self, requires)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-5u2qo23r\overlay\Lib\site-packages\setuptools\installer.py", line 38, in _fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-5u2qo23r\overlay\Lib\site-packages\pkg_resources\__init__.py", line 829, in resolve
          dist = self._resolve_dist(
                 ^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-5u2qo23r\overlay\Lib\site-packages\pkg_resources\__init__.py", line 865, in _resolve_dist
          dist = best[req.key] = env.best_match(
                                 ^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-5u2qo23r\overlay\Lib\site-packages\pkg_resources\__init__.py", line 1135, in best_match
          return self.obtain(req, installer)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-5u2qo23r\overlay\Lib\site-packages\pkg_resources\__init__.py", line 1147, in obtain
          return installer(requirement)
                 ^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-5u2qo23r\overlay\Lib\site-packages\setuptools\installer.py", line 103, in _fetch_build_egg_no_warn
          raise DistutilsError(str(e)) from e
      distutils.errors.DistutilsError: Command '['D:\\Repository\\.venv\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\DRAGON~1\\AppData\\Local\\Temp\\tmpvtocohq7', '--quiet', 'numpy>=1.17.3']' returned non-zero exit status 1.
      [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.

@Dragon1573
Copy link

@William-Fernandes252 - I MADE IT!!! 🎉

Cython is required of this package when installing via pip without PEP 517, but it doesn't included in packages configurations. I also seems scikit-surprise does not compatible with PEP 517. I don't know if poetry can provide such switch for users, but pdm provides a --no-isolation switch to bypass this unexpected bug. scikit-surprise requires joblib numpy and scipy as dependencies, just pdm add them on your own before adding scikit-surprise with --no-isolation.

You can try installing with pip directly without PEP 517. Please follow steps below

✔️ Install via pip, without PEP 517
21:24:13 D:\Repository 2ms pwsh> python --version
Python 3.12.2

21:24:17 D:\Repository 17ms pwsh> python -m venv .venv

21:24:31 D:\Repository 7.097s pwsh> .\.venv\Scripts\Activate.ps1

21:24:43 (Repository) D:\Repository 38ms pwsh> python -m pip install -U pip setuptools wheel Cython
Looking in indexes: https://mirrors.bfsu.edu.cn/pypi/web/simple
Requirement already satisfied: pip in d:\repository\.venv\lib\site-packages (24.0)
Collecting setuptools
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/55/3a/5121b58b578a598b269537e09a316ad2a94fdd561a2c6eb75cd68578cc6b/setuptools-69.0.3-py3-none-any.whl (819 kB)
Collecting wheel
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/c7/c3/55076fc728723ef927521abaa1955213d094933dc36d4a2008d5101e1af5/wheel-0.42.0-py3-none-any.whl (65 kB)
Collecting Cython
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/b4/69/cb4620287cd9ef461103e122c0a2ae7f7ecf183e02510676fb5a15c95b05/Cython-3.0.8-cp312-cp312-win_amd64.whl (2.8 MB)
Installing collected packages: wheel, setuptools, Cython
Successfully installed Cython-3.0.8 setuptools-69.0.3 wheel-0.42.0

21:25:02 (Repository) D:\Repository 6.292s pwsh> python -m pip install -U scikit-surprise
Looking in indexes: https://mirrors.bfsu.edu.cn/pypi/web/simple
Collecting scikit-surprise
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/30/e1/f4f78b7dd32feaa6256f000668a6932e81b899d0e5a5f84ab3fd1f5e2743/scikit-surprise-1.1.3.tar.gz (771 kB)
  Preparing metadata (setup.py) ... done
Collecting joblib>=1.0.0 (from scikit-surprise)
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/10/40/d551139c85db202f1f384ba8bcf96aca2f329440a844f924c8a0040b6d02/joblib-1.3.2-py3-none-any.whl (302 kB)
Collecting numpy>=1.17.3 (from scikit-surprise)
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/16/2e/86f24451c2d530c88daf997cb8d6ac622c1d40d19f5a031ed68a4b73a374/numpy-1.26.4-cp312-cp312-win_amd64.whl (15.5 MB)
Collecting scipy>=1.3.2 (from scikit-surprise)
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/f3/31/91a2a3c5eb85d2bfa86d7c98f2df5d77dcdefb3d80ca9f9037ad04393acf/scipy-1.12.0-cp312-cp312-win_amd64.whl (45.8 MB)
Building wheels for collected packages: scikit-surprise
  Building wheel for scikit-surprise (setup.py) ... done
  Created wheel for scikit-surprise: filename=scikit_surprise-1.1.3-cp312-cp312-win_amd64.whl size=1294302 sha256=3ac7b8ccb983654c504f3f8bf727ff10f46926e4f6b76809c14affbafd7af848
  Stored in directory: d:\applications\python\pip\cache\wheels\08\8f\e0\e0c8b69f220874c42682756d39c3afc31ad4563e574de2ae48
Successfully built scikit-surprise
Installing collected packages: numpy, joblib, scipy, scikit-surprise
Successfully installed joblib-1.3.2 numpy-1.26.4 scikit-surprise-1.1.3 scipy-1.12.0

21:25:52 (Repository) D:\Repository 41.737s pwsh> python -c "from surprise import __version__; print(__version__)"
1.1.3
❌ Install via pip, with PEP 517
21:31:44 D:\Repository 2ms pwsh> python -m venv .venv

21:31:56 D:\Repository 6.742s pwsh> .\.venv\Scripts\Activate.ps1

21:32:01 (Repository) D:\Repository 32ms pwsh> python -m pip install -U --use-pep517 pip setuptools wheel Cython
Looking in indexes: https://mirrors.bfsu.edu.cn/pypi/web/simple
Requirement already satisfied: pip in d:\repository\.venv\lib\site-packages (24.0)
Collecting setuptools
  Downloading https://mirrors.bfsu.edu.cn/pypi/web/packages/55/3a/5121b58b578a598b269537e09a316ad2a94fdd561a2c6eb75cd68578cc6b/setuptools-69.0.3-py3-none-any.whl (819 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 819.5/819.5 kB 10.4 MB/s eta 0:00:00
Collecting wheel
  Downloading https://mirrors.bfsu.edu.cn/pypi/web/packages/c7/c3/55076fc728723ef927521abaa1955213d094933dc36d4a2008d5101e1af5/wheel-0.42.0-py3-none-any.whl (65 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.4/65.4 kB ? eta 0:00:00
Collecting Cython
  Downloading https://mirrors.bfsu.edu.cn/pypi/web/packages/b4/69/cb4620287cd9ef461103e122c0a2ae7f7ecf183e02510676fb5a15c95b05/Cython-3.0.8-cp312-cp312-win_amd64.whl (2.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.8/2.8 MB 14.9 MB/s eta 0:00:00
Installing collected packages: wheel, setuptools, Cython
Successfully installed Cython-3.0.8 setuptools-69.0.3 wheel-0.42.0

21:32:13 (Repository) D:\Repository 6.735s pwsh> python -m pip install -U --use-pep517 scikit-surprise
Looking in indexes: https://mirrors.bfsu.edu.cn/pypi/web/simple
Collecting scikit-surprise
  Downloading https://mirrors.bfsu.edu.cn/pypi/web/packages/30/e1/f4f78b7dd32feaa6256f000668a6932e81b899d0e5a5f84ab3fd1f5e2743/scikit-surprise-1.1.3.tar.gz (771 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 772.0/772.0 kB 3.0 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [60 lines of output]
      <string>: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`.
              ********************************************************************************

      !!
      WARNING: The wheel package is not available.
      D:\Repository\.venv\Scripts\python.exe: No module named pip
      Traceback (most recent call last):
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-_pe5iwyv\overlay\Lib\site-packages\setuptools\installer.py", line 101, in _fetch_build_egg_no_warn
          subprocess.check_call(cmd)
        File "D:\Applications\Python\cp312\Lib\subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['D:\\Repository\\.venv\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\DRAGON~1\\AppData\\Local\\Temp\\tmphyx45nv9', '--quiet', 'numpy>=1.17.3']' returned non-zero exit status 1.

      The above exception was the direct cause of the following exception:

      Traceback (most recent call last):
        File "D:\Repository\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "D:\Repository\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "D:\Repository\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-_pe5iwyv\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-_pe5iwyv\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-_pe5iwyv\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-_pe5iwyv\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 65, in <module>
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-_pe5iwyv\overlay\Lib\site-packages\setuptools\dist.py", line 636, in fetch_build_eggs
          return _fetch_build_eggs(self, requires)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-_pe5iwyv\overlay\Lib\site-packages\setuptools\installer.py", line 38, in _fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-_pe5iwyv\overlay\Lib\site-packages\pkg_resources\__init__.py", line 829, in resolve
          dist = self._resolve_dist(
                 ^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-_pe5iwyv\overlay\Lib\site-packages\pkg_resources\__init__.py", line 865, in _resolve_dist
          dist = best[req.key] = env.best_match(
                                 ^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-_pe5iwyv\overlay\Lib\site-packages\pkg_resources\__init__.py", line 1135, in best_match
          return self.obtain(req, installer)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-_pe5iwyv\overlay\Lib\site-packages\pkg_resources\__init__.py", line 1147, in obtain
          return installer(requirement)
                 ^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dragon1573\AppData\Local\Temp\pip-build-env-_pe5iwyv\overlay\Lib\site-packages\setuptools\installer.py", line 103, in _fetch_build_egg_no_warn
          raise DistutilsError(str(e)) from e
      distutils.errors.DistutilsError: Command '['D:\\Repository\\.venv\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\DRAGON~1\\AppData\\Local\\Temp\\tmphyx45nv9', '--quiet', 'numpy>=1.17.3']' returned non-zero exit status 1.
      [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.
❌ Install via pdm
21:37:59 D:\...\Python 2ms pwsh> pdm add -d Cython
Adding packages to dev dev-dependencies: Cython
🔒 Lock successful
Changes are written to pyproject.toml.
Synchronizing working set with resolved packages: 1 to add, 0 to update, 0 to remove

  ✔ Install cython 3.0.8 successful

🎉 All complete!

21:38:28 D:\...\Python 9.106s pwsh> pdm add -d scikit-surprise
Adding packages to dev dev-dependencies: scikit-surprise
🔒 Lock successful
Changes are written to pyproject.toml.
Synchronizing working set with resolved packages: 1 to add, 0 to update, 0 to remove

  ✖ Install scikit-surprise 1.1.3 failed
Retry failed jobs
  ✖ Install scikit-surprise 1.1.3 failed

ERRORS:
add scikit-surprise failed:
Traceback (most recent call last):
  File "D:\Applications\Python\cp312\Lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\installers\synchronizers.py", line 286, in install_candidate
    self.manager.install(can)
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\installers\manager.py", line 34, in install
    dist_info = installer(str(prepared.build()), self.environment, prepared.direct_url())
                              ^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\models\candidates.py", line 418, in build
    self.wheel = Path(builder.build(build_dir, metadata_directory=self._metadata_dir))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\builders\wheel.py", line 26, in build
    requires = self._hook.get_requires_for_build_wheel(config_settings)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pyproject_hooks\_impl.py", line 166, in get_requires_for_build_wheel
    return self._call_hook('get_requires_for_build_wheel', {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pyproject_hooks\_impl.py", line 311, in _call_hook
    self._subprocess_runner(
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\builders\base.py", line 261, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Applications\Python\pipx\venvs\pdm\Lib\site-packages\pdm\builders\base.py", line 107, in log_subprocessor
    raise build_error(e) from None
pdm.exceptions.BuildError: Build backend raised error: Showing the last 10 lines of the build output:
                           ^^^^^^^^^^^^^^^
  File "C:\Users\DRAGON~1\AppData\Local\Temp\pdm-build-env-vs03wulk-shared\Lib\site-packages\pkg_resources\__init__.py", line 1119, in best_match
    return self.obtain(req, installer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\DRAGON~1\AppData\Local\Temp\pdm-build-env-vs03wulk-shared\Lib\site-packages\pkg_resources\__init__.py", line 1130, in obtain
    return installer(requirement) if installer else None
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\DRAGON~1\AppData\Local\Temp\pdm-build-env-vs03wulk-shared\Lib\site-packages\setuptools\installer.py", line 103, in
_fetch_build_egg_no_warn
    raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['D:\\Repository\\Python\\.venv\\cp312\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check',
'wheel', '--no-deps', '-w', 'C:\\Users\\DRAGON~1\\AppData\\Local\\Temp\\tmp_041ahf2', '--quiet', 'numpy>=1.17.3']' returned non-zero exit status 1.

See C:\Users\DRAGON~1\AppData\Local\Temp\pdm-install-wkp7cx44.log for detailed debug log.
[InstallationError]: Some package operations are not complete yet
WARNING: Add '-v' to see the detailed traceback
✔️ Install via pdm, with --no-isolation
21:56:55 (cp312) D:\...\Python 2ms pwsh> pdm add -d joblib numpy scipy && pdm add -d --no-isolation scikit-surprise
Adding packages to dev dev-dependencies: joblib, numpy, scipy
🔒 Lock successful
Changes are written to pyproject.toml.
Synchronizing working set with resolved packages: 3 to add, 0 to update, 0 to remove

  ✔ Install joblib 1.3.2 successful
  ✔ Install numpy 1.26.4 successful
  ✔ Install scipy 1.12.0 successful

🎉 All complete!

Adding packages to dev dev-dependencies: scikit-surprise
🔒 Lock successful
Changes are written to pyproject.toml.
Synchronizing working set with resolved packages: 1 to add, 0 to update, 0 to remove

  ✔ Install scikit-surprise 1.1.3 successful

🎉 All complete!

21:57:48 (cp312) D:\...\Python 24.948s pwsh> pdm run python -c "from surprise import __version__; print(__version__)"
1.1.3

21:57:57 (cp312) D:\...\Python 3.117s pwsh> pdm list --tree --include dev
scikit-surprise 1.1.3 [ required: >=1.1.3 ]
├── joblib 1.3.2 [ required: >=1.0.0 ]
├── numpy 1.26.4 [ required: >=1.17.3 ]
└── scipy 1.12.0 [ required: >=1.3.2 ]
    └── numpy 1.26.4 [ required: <1.29.0,>=1.22.4 ]

@bbelescot
Copy link

I'm also unable to install this package using Poetry (thus with no direct control on PEP 517)

@RubTalha
Copy link

@rodrigc
Copy link

rodrigc commented May 8, 2024

@RubTalha @bbelescot @Dragon1573 @William-Fernandes252 @kwasiewicz002 can you test
the change done in #476 by @abhi8893
by doing this:

pip install git+https://github.com/abhi8893/Surprise@implement-pyproject-pkging

@Dragon1573
Copy link

Pull request #476 verified 🎉

19:40:39 D:\...\Python 31ms pwsh> conda activate .\.venv\

19:40:44 (Python) D:\...\Python 294ms pwsh> python -m pip install git+https://github.com/abhi8893/Surprise@implement-pyproject-pkging
Looking in indexes: https://mirrors.bfsu.edu.cn/pypi/web/simple
Collecting git+https://github.com/abhi8893/Surprise@implement-pyproject-pkging
  Cloning https://github.com/abhi8893/Surprise (to revision implement-pyproject-pkging) to c:\users\dragon1573\appdata\local\temp\pip-req-build-hh5cjsgr
  Running command git clone --filter=blob:none --quiet https://github.com/abhi8893/Surprise 'C:\Users\Dragon1573\AppData\Local\Temp\pip-req-build-hh5cjsgr'
  Running command git checkout -b implement-pyproject-pkging --track origin/implement-pyproject-pkging
  branch 'implement-pyproject-pkging' set up to track 'origin/implement-pyproject-pkging'.
  Switched to a new branch 'implement-pyproject-pkging'
  Resolved https://github.com/abhi8893/Surprise to commit 9c7dbc856b7d0b38cc8738b6594fe34f7b20d261
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting joblib>=1.0.0 (from scikit-surprise==1.1.4)
  Downloading https://mirrors.bfsu.edu.cn/pypi/web/packages/91/29/df4b9b42f2be0b623cbd5e2140cafcaa2bef0759a00b7b70104dcfe2fb51/joblib-1.4.2-py3-none-any.whl (301 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 301.8/301.8 kB 1.7 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.17.3 in d:\repository\python\.venv\lib\site-packages (from scikit-surprise==1.1.4) (1.26.4)
Collecting scipy>=1.3.2 (from scikit-surprise==1.1.4)
  Downloading https://mirrors.bfsu.edu.cn/pypi/web/packages/d4/a1/d4adf25b6d2bef8d0ad1682829dcfcba97f3f96bb5b6f137bc3e41003cc7/scipy-1.13.0-cp311-cp311-win_amd64.whl (46.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.2/46.2 MB 11.5 MB/s eta 0:00:00
Building wheels for collected packages: scikit-surprise
  Building wheel for scikit-surprise (pyproject.toml) ... done
  Created wheel for scikit-surprise: filename=scikit_surprise-1.1.4-cp311-cp311-win_amd64.whl size=1401108 sha256=ac13b0ee2a2be597053d7ee32669771b2c5ed6f5f67eaa0bcdfe9fca71dbe55b
  Stored in directory: C:\Users\Dragon1573\AppData\Local\Temp\pip-ephem-wheel-cache-ha7m9dd3\wheels\50\fe\33\4ea0cbc6aa99037dfac412e2445f3cc849bb41f824606f654b
Successfully built scikit-surprise
Installing collected packages: scipy, joblib, scikit-surprise
Successfully installed joblib-1.4.2 scikit-surprise-1.1.4 scipy-1.13.0

19:42:12 (Python) D:\...\Python 1m 14.059s pwsh> python --version
Python 3.11.9

19:42:43 (Python) D:\...\Python 27ms pwsh> python -c "from sys import version; print(version)"
3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:27:10) [MSC v.1938 64 bit (AMD64)]

@NicolasHug
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants