

タイトルの通り、[scikit-sparse パッケージ](https://github.com/scikit-sparse/scikit-sparse)
をインストールしたいのですが、エラーを解決できず行き詰っております。  
Pythonのバージョンはpython 3.10.7です。

PowerShell から以下の通りコマンドを一行ずつ順に試してみましたが、エラーが発生してしまいます。  
(エラーメッセージ中の "hogehoge" はユーザー名です)

英語はわかりませんが、pipの問題ではないと言っていることはわかりました。  
また、setup.pyがどうも実行できていないということも何となくわかりました。  
しかし、ではどう解決したらいいのかということがわかりません。  
ご助言をいただきたいです。よろしくお願いします。

**実行したコマンド:**

[code]

    py -m pip install -U pip
    py -m pip install -U wheel
    py -m pip install -U setuptools
    py -m pip install scikit-sparse
    
[/code]

**エラーメッセージ:**

[code]

    Collecting scikit-sparse
      Using cached scikit-sparse-0.4.4.tar.gz (385 kB)
      Preparing metadata (setup.py) ... done
    Requirement already satisfied: numpy in c:\users\hogehoge\appdata\local\programs\python\python310\lib\site-packages (from scikit-sparse) (1.21.6)
    Requirement already satisfied: scipy in c:\users\hogehoge\appdata\local\programs\python\python310\lib\site-packages (from scikit-sparse) (1.7.3)
    Building wheels for collected packages: scikit-sparse
      Building wheel for scikit-sparse (setup.py) ... error
      error: subprocess-exited-with-error
    
      × python setup.py bdist_wheel did not run successfully.
      │ exit code: 1
      ╰─> [33 lines of output]
          C:\Users\hogehoge\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
            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\sksparse
          copying sksparse\test_cholmod.py -> build\lib.win-amd64-cpython-310\sksparse
          copying sksparse\_version.py -> build\lib.win-amd64-cpython-310\sksparse
          copying sksparse\__init__.py -> build\lib.win-amd64-cpython-310\sksparse
          creating build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\illc1033.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\illc1033_rhs1.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\illc1850.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\illc1850_rhs1.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\well1033.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\well1033_rhs1.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\well1850.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\well1850_rhs1.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          UPDATING build\lib.win-amd64-cpython-310\sksparse/_version.py
          set build\lib.win-amd64-cpython-310\sksparse/_version.py to '0.4.4'
          running build_ext
          skipping 'sksparse\cholmod.c' Cython extension (up-to-date)
          building 'sksparse.cholmod' extension
          creating build\temp.win-amd64-cpython-310
          creating build\temp.win-amd64-cpython-310\Release
          creating build\temp.win-amd64-cpython-310\Release\sksparse
          "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\hogehoge\AppData\Local\Programs\Python\Python310\lib\site-packages\numpy\core\include -IC:\Users\hogehoge\AppData\Local\Programs\Python\Python310/include -I/usr/include/suitesparse -IC:\Users\hogehoge\AppData\Local\Programs\Python\Python310\include -IC:\Users\hogehoge\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsksparse\cholmod.c /Fobuild\temp.win-amd64-cpython-310\Release\sksparse\cholmod.obj
          cholmod.c
          C:\Users\hogehoge\AppData\Local\Programs\Python\Python310\lib\site-packages\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
          C:\Users\hogehoge\AppData\Local\Temp\pip-install-iu1qbymb\scikit-sparse_3040893b73c5464a8fdd40f0232c94fe\sksparse\cholmod_backward_compatible.h(1): fatal error C1083: include ファイルを開けません。'cholmod.h':No such file or directory
          error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\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-sparse
      Running setup.py clean for scikit-sparse
    Failed to build scikit-sparse
    Installing collected packages: scikit-sparse
      Running setup.py install for scikit-sparse ... error
      error: subprocess-exited-with-error
    
      × Running setup.py install for scikit-sparse did not run successfully.
      │ exit code: 1
      ╰─> [35 lines of output]
          C:\Users\hogehoge\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
            warnings.warn(
          running install
          C:\Users\hogehoge\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
            warnings.warn(
          running build
          running build_py
          creating build
          creating build\lib.win-amd64-cpython-310
          creating build\lib.win-amd64-cpython-310\sksparse
          copying sksparse\test_cholmod.py -> build\lib.win-amd64-cpython-310\sksparse
          copying sksparse\_version.py -> build\lib.win-amd64-cpython-310\sksparse
          copying sksparse\__init__.py -> build\lib.win-amd64-cpython-310\sksparse
          creating build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\illc1033.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\illc1033_rhs1.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\illc1850.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\illc1850_rhs1.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\well1033.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\well1033_rhs1.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\well1850.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          copying sksparse\test_data\well1850_rhs1.mtx.gz -> build\lib.win-amd64-cpython-310\sksparse\test_data
          UPDATING build\lib.win-amd64-cpython-310\sksparse/_version.py
          set build\lib.win-amd64-cpython-310\sksparse/_version.py to '0.4.4'
          running build_ext
          skipping 'sksparse\cholmod.c' Cython extension (up-to-date)
          building 'sksparse.cholmod' extension
          creating build\temp.win-amd64-cpython-310
          creating build\temp.win-amd64-cpython-310\Release
          creating build\temp.win-amd64-cpython-310\Release\sksparse
          "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\hogehoge\AppData\Local\Programs\Python\Python310\lib\site-packages\numpy\core\include -IC:\Users\hogehoge\AppData\Local\Programs\Python\Python310/include -I/usr/include/suitesparse -IC:\Users\hogehoge\AppData\Local\Programs\Python\Python310\include -IC:\Users\hogehoge\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsksparse\cholmod.c /Fobuild\temp.win-amd64-cpython-310\Release\sksparse\cholmod.obj
          cholmod.c
          C:\Users\hogehoge\AppData\Local\Programs\Python\Python310\lib\site-packages\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
          C:\Users\hogehoge\AppData\Local\Temp\pip-install-iu1qbymb\scikit-sparse_3040893b73c5464a8fdd40f0232c94fe\sksparse\cholmod_backward_compatible.h(1): fatal error C1083: include ファイルを開けません。'cholmod.h':No such file or directory
          error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\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: legacy-install-failure
    
    × Encountered error while trying to install package.
    ╰─> scikit-sparse
    
    note: This is an issue with the package mentioned above, not pip.
    hint: See above for output from the failure.
    
[/code]


CC BY-SA 4.0
2022-10-10T03:16:38.193
91522
2022-10-13T05:16:21.247
2022-10-13T05:16:21.247
3060
54778
question
python
scikit-sparseインストール時のエラーを解決できない