Home > Blockchain >  Can't install the package scikit-learn-extra
Can't install the package scikit-learn-extra

Time:02-01

I received a python file from a contributor who makes use of the scikit-learn-extra library. When I try to install it I get the following error:

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

I've tried to Install a greater Version of Microsoft Visual C but it dosen't work. On the machine of my collaborator it works. He has a linux OS. I've also tried to install by downloading the repository and running python setup.py install but I got this error:

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'

CodePudding user response:

This error usually occurs when there is a problem with the installation of the dependencies required by the scikit-learn-extra library. To resolve this error, try the following steps:

Check the requirements mentioned in the documentation of scikit-learn-extra library and make sure that all the required dependencies are installed in your system.

Try installing the library using the latest version of pip by running the command "pip install --upgrade pip".

If the problem persists, try installing the library in a virtual environment to avoid any conflicts with other packages installed in your system.

If the above steps don't work, try installing the library using the source code by cloning the repository and running "python setup.py install".

If none of the above steps work, you may try contacting the contributor for more information or support.

  • Related