c++ 无法安装软件包scikit-learn-extra

iklwldmw  于 2023-02-01  发布在  其他
关注(0)|答案(1)|浏览(177)

我从一个使用scikit-learn-extra库的贡献者那里收到了一个python文件,当我试图安装它时,我得到了以下错误:

error: subprocess-exited-with-error

  × Building wheel for scikit-learn-extra (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [49 lines of output]
      C:\Users\bogda\AppData\Local\Temp\pip-build-env-0mronz9o\overlay\Lib\site-packages\setuptools\dist.py:775: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
        warnings.warn(
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\benchmarks
      copying benchmarks\bench_rbfsampler_fastfood.py -> build\lib.win-amd64-cpython-310\benchmarks
      copying benchmarks\__init__.py -> build\lib.win-amd64-cpython-310\benchmarks
      creating build\lib.win-amd64-cpython-310\sklearn_extra
      copying sklearn_extra\_version.py -> build\lib.win-amd64-cpython-310\sklearn_extra
      copying sklearn_extra\__init__.py -> build\lib.win-amd64-cpython-310\sklearn_extra
      creating build\lib.win-amd64-cpython-310\benchmarks\_bench
      copying benchmarks\_bench\eigenpro_plot_mnist.py -> build\lib.win-amd64-cpython-310\benchmarks\_bench
      copying benchmarks\_bench\eigenpro_plot_noisy_mnist.py -> build\lib.win-amd64-cpython-310\benchmarks\_bench
      copying benchmarks\_bench\eigenpro_plot_synthetic.py -> build\lib.win-amd64-cpython-310\benchmarks\_bench
      copying benchmarks\_bench\robust_plot_synthetic.py -> build\lib.win-amd64-cpython-310\benchmarks\_bench
      copying benchmarks\_bench\__init__.py -> build\lib.win-amd64-cpython-310\benchmarks\_bench
      creating build\lib.win-amd64-cpython-310\sklearn_extra\cluster
      copying sklearn_extra\cluster\_commonnn.py -> build\lib.win-amd64-cpython-310\sklearn_extra\cluster
      copying sklearn_extra\cluster\_k_medoids.py -> build\lib.win-amd64-cpython-310\sklearn_extra\cluster
      copying sklearn_extra\cluster\__init__.py -> build\lib.win-amd64-cpython-310\sklearn_extra\cluster
      creating build\lib.win-amd64-cpython-310\sklearn_extra\kernel_approximation
      copying sklearn_extra\kernel_approximation\test_fastfood.py -> build\lib.win-amd64-cpython-310\sklearn_extra\kernel_approximation
      copying sklearn_extra\kernel_approximation\_fastfood.py -> build\lib.win-amd64-cpython-310\sklearn_extra\kernel_approximation
      copying sklearn_extra\kernel_approximation\__init__.py -> build\lib.win-amd64-cpython-310\sklearn_extra\kernel_approximation
      creating build\lib.win-amd64-cpython-310\sklearn_extra\kernel_methods
      copying sklearn_extra\kernel_methods\_eigenpro.py -> build\lib.win-amd64-cpython-310\sklearn_extra\kernel_methods
      copying sklearn_extra\kernel_methods\__init__.py -> build\lib.win-amd64-cpython-310\sklearn_extra\kernel_methods
      creating build\lib.win-amd64-cpython-310\sklearn_extra\robust
      copying sklearn_extra\robust\mean_estimators.py -> build\lib.win-amd64-cpython-310\sklearn_extra\robust
      copying sklearn_extra\robust\robust_weighted_estimator.py -> build\lib.win-amd64-cpython-310\sklearn_extra\robust
      copying sklearn_extra\robust\__init__.py -> build\lib.win-amd64-cpython-310\sklearn_extra\robust
      creating build\lib.win-amd64-cpython-310\sklearn_extra\tests
      copying sklearn_extra\tests\test_common.py -> build\lib.win-amd64-cpython-310\sklearn_extra\tests
      copying sklearn_extra\tests\__init__.py -> build\lib.win-amd64-cpython-310\sklearn_extra\tests
      creating build\lib.win-amd64-cpython-310\sklearn_extra\cluster\tests
      copying sklearn_extra\cluster\tests\test_commonnn.py -> build\lib.win-amd64-cpython-310\sklearn_extra\cluster\tests
      copying sklearn_extra\cluster\tests\test_k_medoids.py -> build\lib.win-amd64-cpython-310\sklearn_extra\cluster\tests
      copying sklearn_extra\cluster\tests\__init__.py -> build\lib.win-amd64-cpython-310\sklearn_extra\cluster\tests
      creating build\lib.win-amd64-cpython-310\sklearn_extra\kernel_approximation\tests
      copying sklearn_extra\kernel_approximation\tests\__init__.py -> build\lib.win-amd64-cpython-310\sklearn_extra\kernel_approximation\tests
      creating build\lib.win-amd64-cpython-310\sklearn_extra\kernel_methods\tests
      copying sklearn_extra\kernel_methods\tests\test_eigenpro.py -> build\lib.win-amd64-cpython-310\sklearn_extra\kernel_methods\tests
      copying sklearn_extra\kernel_methods\tests\__init__.py -> build\lib.win-amd64-cpython-310\sklearn_extra\kernel_methods\tests
      running build_ext
      building 'sklearn_extra.utils._cyfht' extension
      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: Failed building wheel for scikit-learn-extra
Failed to build scikit-learn-extra
ERROR: Could not build wheels for scikit-learn-extra, which is required to install pyproject.toml-based projects

我尝试安装Microsoft Visual C++的更高版本,但它不工作。在我的合作者的机器上,它的工作。他有一个linux操作系统。我也尝试通过下载仓库和运行python setup.py install安装,但我得到了这个错误:

Traceback (most recent call last):
  File "C:\Users\bogda\Desktop\scikit-learn-extra-main\setup.py", line 8, in <module>
    from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'
ryevplcw

ryevplcw1#

这个错误通常发生在scikit-learn-extra库所需的依赖项的安装有问题时。要解决这个错误,请尝试以下步骤:
检查scikit-learn-extra库文档中提到的要求,并确保所有必需的依赖项都安装在您的系统中。
尝试通过运行命令“pip install --upgrade pip”使用最新版本的pip安装库。
如果问题仍然存在,请尝试在虚拟环境中安装库,以避免与系统中安装的其他软件包发生任何冲突。
如果以上步骤不起作用,请尝试使用源代码安装库,方法是克隆存储库并运行“pythonsetup.pyinstall”。
如果以上步骤都不起作用,您可以尝试联系贡献者以获取更多信息或支持。

相关问题