Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyheif Not Installing with pip command #90

Open
windrh opened this issue Jul 13, 2023 · 5 comments
Open

Pyheif Not Installing with pip command #90

windrh opened this issue Jul 13, 2023 · 5 comments

Comments

@windrh
Copy link

windrh commented Jul 13, 2023

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

@homm
Copy link
Contributor

homm commented Jul 14, 2023

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:

  1. Create a directory to store the libheif library files. For example, you can create a directory called C:\libheif.
  2. 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.
  3. Add the directory C:\libheif to the system's PATH environment variable. This will allow the installation process to locate the libheif files.
  4. Retry the installation of the pyheif package using pip.

@windrh
Copy link
Author

windrh commented Jul 16, 2023

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.

@homm
Copy link
Contributor

homm commented Jul 16, 2023

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?

@ronikawi
Copy link

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.

@M450NC
Copy link

M450NC commented Feb 18, 2024

Also having the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants