Pyheif Not Installing with pip command
Opened this issue · 7 comments
I get this error log from installing it with pip. Where should I place my libheif files?
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [25 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-39
creating build\lib.win-amd64-cpython-39\pyheif
copying pyheif\constants.py -> build\lib.win-amd64-cpython-39\pyheif
copying pyheif\error.py -> build\lib.win-amd64-cpython-39\pyheif
copying pyheif\reader.py -> build\lib.win-amd64-cpython-39\pyheif
copying pyheif\writer.py -> build\lib.win-amd64-cpython-39\pyheif
copying pyheif_init_.py -> build\lib.win-amd64-cpython-39\pyheif
creating build\lib.win-amd64-cpython-39\pyheif\data
copying pyheif\data\version.txt -> build\lib.win-amd64-cpython-39\pyheif\data
running build_ext
generating cffi module 'build\temp.win-amd64-cpython-39\Release\_libheif_cffi.c'
creating build\temp.win-amd64-cpython-39
creating build\temp.win-amd64-cpython-39\Release
building '_libheif_cffi' extension
creating build\temp.win-amd64-cpython-39\Release\build
creating build\temp.win-amd64-cpython-39\Release\build\temp.win-amd64-cpython-39
creating build\temp.win-amd64-cpython-39\Release\build\temp.win-amd64-cpython-39\Release
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -I/usr/local/include -I/usr/include -I/opt/local/include -IC:\Users\willh\PycharmProjects\hoffmanserver\venv\include -IC:\Users\willh\AppData\Local\Programs\Python\Python39\include -IC:\Users\willh\AppData\Local\Programs\Python\Python39\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\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" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcbuild\temp.win-amd64-cpython-39\Release_libheif_cffi.c /Fobuild\temp.win-amd64-cpython-39\Release\build\temp.win-amd64-cpython-39\Release_libheif_cffi.obj
_libheif_cffi.c
build\temp.win-amd64-cpython-39\Release_libheif_cffi.c(570): fatal error C1083: Cannot open include file: 'libheif/heif.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\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 pyheif
ERROR: Could not build wheels for pyheif, which is required to install pyproject.toml-based projects
Response generated by GPT 3.5
You should follow the instructions specific to Windows for placing the libheif library files.
Here's what you can do:
- Create a directory to store the
libheif
library files. For example, you can create a directory calledC:\libheif
. - Place the
libheif
library files (header files and dynamic library files) in this directory. Ensure that you have the necessary header file (e.g.,heif.h
) and the dynamic library file (e.g.,libheif.dll
) available. - Add the directory
C:\libheif
to the system's PATH environment variable. This will allow the installation process to locate thelibheif
files. - Retry the installation of the
pyheif
package usingpip
.
I followed the instructions. I have the folder on my computer and have added the directory to the system path. However, it still gives the same error code.
Does your dir appear in error message in cl.exe options like other dirs?
Are you sure that you have libheif/heif.h
file path inside this dir?
hi @homm i followed your instructions but still got the same error. could you please help? since i got stuck on this error for long time. trying to research the solution but still stuck.
Also having the same issue.
Have any of you figured it out yet?