nfft3.h: No such file or directory

Пытаюсь установить библиотеку pyNFFT2 через pip, но получаю ошибку.

Способ из этого вопроса не помог.

$ pip install pyNFFT2
Collecting pyNFFT2
  Using cached pynfft2-1.4.3.tar.gz (288 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pyNFFT2
  Building wheel for pyNFFT2 (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [34 lines of output]
      C:\Users\79080\AppData\Local\Temp\pip-install-1o00bodj\pynfft2_fad002d79b1f4e9b91bbe28bd366baef\setup.py:219: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
        import imp
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\pynfft
      copying pynfft\version.py -> build\lib.win-amd64-cpython-310\pynfft
      copying pynfft\__init__.py -> build\lib.win-amd64-cpython-310\pynfft
      creating build\lib.win-amd64-cpython-310\pynfft\tests
      copying pynfft\tests\test_nfft.py -> build\lib.win-amd64-cpython-310\pynfft\tests
      copying pynfft\tests\__init__.py -> build\lib.win-amd64-cpython-310\pynfft\tests
      running build_ext
      building 'pynfft.nfft' extension
      creating build\temp.win-amd64-cpython-310
      creating build\temp.win-amd64-cpython-310\Release
      creating build\temp.win-amd64-cpython-310\Release\Users
      creating build\temp.win-amd64-cpython-310\Release\Users\79080
      creating build\temp.win-amd64-cpython-310\Release\Users\79080\AppData
      creating build\temp.win-amd64-cpython-310\Release\Users\79080\AppData\Local
      creating build\temp.win-amd64-cpython-310\Release\Users\79080\AppData\Local\Temp
      creating build\temp.win-amd64-cpython-310\Release\Users\79080\AppData\Local\Temp\pip-install-1o00bodj
      creating build\temp.win-amd64-cpython-310\Release\Users\79080\AppData\Local\Temp\pip-install-1o00bodj\pynfft2_fad002d79b1f4e9b91bbe28bd366baef
      creating build\temp.win-amd64-cpython-310\Release\Users\79080\AppData\Local\Temp\pip-install-1o00bodj\pynfft2_fad002d79b1f4e9b91bbe28bd366baef\pynfft
      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\79080\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\numpy\core\include "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\Include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\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" /TcC:\Users\79080\AppData\Local\Temp\pip-install-1o00bodj\pynfft2_fad002d79b1f4e9b91bbe28bd366baef\pynfft\nfft.c /Fobuild\temp.win-amd64-cpython-310\Release\Users\79080\AppData\Local\Temp\pip-install-1o00bodj\pynfft2_fad002d79b1f4e9b91bbe28bd366baef\pynfft\nfft.obj -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math
      cl: Є®¬ ­¤­ п бва®Є  warning D9002: Їа®ЇгбЄ ­ҐЁ§ўҐбв­®Ј® Ї а ¬Ґва  "-O3"
      cl: Є®¬ ­¤­ п бва®Є  warning D9002: Їа®ЇгбЄ ­ҐЁ§ўҐбв­®Ј® Ї а ¬Ґва  "-fomit-frame-pointer"
      cl: Є®¬ ­¤­ п бва®Є  warning D9002: Їа®ЇгбЄ ­ҐЁ§ўҐбв­®Ј® Ї а ¬Ґва  "-malign-double"
      cl: Є®¬ ­¤­ п бва®Є  warning D9002: Їа®ЇгбЄ ­ҐЁ§ўҐбв­®Ј® Ї а ¬Ґва  "-fstrict-aliasing"
      cl: Є®¬ ­¤­ п бва®Є  warning D9002: Їа®ЇгбЄ ­ҐЁ§ўҐбв­®Ј® Ї а ¬Ґва  "-ffast-math"
      nfft.c
      C:\Users\79080\AppData\Local\Temp\pip-install-1o00bodj\pynfft2_fad002d79b1f4e9b91bbe28bd366baef\pynfft\nfft.c(1258): fatal error C1083: ЌҐ г¤ Ґвбп ®вЄалвм д ©« ўЄ«о祭ЁҐ: nfft3.h: No such file or directory,
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.40.33807\\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 pyNFFT2
  Running setup.py clean for pyNFFT2
Failed to build pyNFFT2
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyNFFT2)

Ответы (1 шт):

Автор решения: Johnny-kiv

Пробуйте найти папку библиотеки pyNFFT2 и вставить ее в папку с вашим проектом. Если у вас linux стоит на компьютере она находится в папке \lib\, а если windows C:\Python\Lib\site-packages\.

→ Ссылка