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

pip install pyheif doesnt work on windows #2

Closed
CheyenneForbes opened this issue Aug 31, 2019 · 12 comments
Closed

pip install pyheif doesnt work on windows #2

CheyenneForbes opened this issue Aug 31, 2019 · 12 comments

Comments

@CheyenneForbes
Copy link

No description provided.

@AlexSSD7
Copy link

AlexSSD7 commented Sep 7, 2019

Install libheif

@BiatuAutMiahn
Copy link

  ----------------------------------------
  Failed building wheel for pyheif
  Running setup.py clean for pyheif
Failed to build pyheif
Installing collected packages: pyheif
  Running setup.py install for pyheif ... error
    Complete output from command C:\ProgramData\Miniconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Biatu\\AppData\\Local\\Temp\\pip-install-ci7ltu2o\\pyheif\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Biatu\AppData\Local\Temp\pip-record-g6u6oulu\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.7
    creating build\lib.win-amd64-3.7\pyheif
    copying pyheif\constants.py -> build\lib.win-amd64-3.7\pyheif
    copying pyheif\error.py -> build\lib.win-amd64-3.7\pyheif
    copying pyheif\reader.py -> build\lib.win-amd64-3.7\pyheif
    copying pyheif\writer.py -> build\lib.win-amd64-3.7\pyheif
    copying pyheif\__init__.py -> build\lib.win-amd64-3.7\pyheif
    running build_ext
    generating cffi module 'build\\temp.win-amd64-3.7\\Release\\_libheif_cffi.c'
    creating build\temp.win-amd64-3.7
    creating build\temp.win-amd64-3.7\Release
    building '_libheif_cffi' extension
    creating build\temp.win-amd64-3.7\Release\build
    creating build\temp.win-amd64-3.7\Release\build\temp.win-amd64-3.7
    creating build\temp.win-amd64-3.7\Release\build\temp.win-amd64-3.7\Release
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/local/include -IC:\ProgramData\Miniconda3\include -IC:\ProgramData\Miniconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcbuild\temp.win-amd64-3.7\Release\_libheif_cffi.c /Fobuild\temp.win-amd64-3.7\Release\build\temp.win-amd64-3.7\Release\_libheif_cffi.obj
    _libheif_cffi.c
    build\temp.win-amd64-3.7\Release\_libheif_cffi.c(493): fatal error C1083: Cannot open include file: 'libheif/heif.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.22.27905\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

@AlexSSD7
Copy link

AlexSSD7 commented Sep 8, 2019

Cannot open include file: 'libheif/heif.h': No such file or directory

This means you haven't got libheif installed

@BiatuAutMiahn
Copy link

There is not way to install libheif on windows afaik.
Manually placed libheif v1.5.1 from https://github.com/strukturag/libheif/releases in to the include path, and got this error:

 ----------------------------------------
  Failed building wheel for pyheif
  Running setup.py clean for pyheif
Failed to build pyheif
Installing collected packages: pyheif
  Running setup.py install for pyheif ... error
    Complete output from command C:\ProgramData\Miniconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Biatu\\AppData\\Local\\Temp\\pip-install-a9n54kej\\pyheif\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Biatu\AppData\Local\Temp\pip-record-46jgh7vj\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.7
    creating build\lib.win-amd64-3.7\pyheif
    copying pyheif\constants.py -> build\lib.win-amd64-3.7\pyheif
    copying pyheif\error.py -> build\lib.win-amd64-3.7\pyheif
    copying pyheif\reader.py -> build\lib.win-amd64-3.7\pyheif
    copying pyheif\writer.py -> build\lib.win-amd64-3.7\pyheif
    copying pyheif\__init__.py -> build\lib.win-amd64-3.7\pyheif
    running build_ext
    generating cffi module 'build\\temp.win-amd64-3.7\\Release\\_libheif_cffi.c'
    creating build\temp.win-amd64-3.7
    creating build\temp.win-amd64-3.7\Release
    building '_libheif_cffi' extension
    creating build\temp.win-amd64-3.7\Release\build
    creating build\temp.win-amd64-3.7\Release\build\temp.win-amd64-3.7
    creating build\temp.win-amd64-3.7\Release\build\temp.win-amd64-3.7\Release
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/local/include -IC:\ProgramData\Miniconda3\include -IC:\ProgramData\Miniconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcbuild\temp.win-amd64-3.7\Release\_libheif_cffi.c /Fobuild\temp.win-amd64-3.7\Release\build\temp.win-amd64-3.7\Release\_libheif_cffi.obj
    _libheif_cffi.c
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:/usr/local/lib /LIBPATH:C:\ProgramData\Miniconda3\libs /LIBPATH:C:\ProgramData\Miniconda3\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64" heif.lib /EXPORT:PyInit__libheif_cffi build\temp.win-amd64-3.7\Release\build\temp.win-amd64-3.7\Release\_libheif_cffi.obj /OUT:build\lib.win-amd64-3.7\_libheif_cffi.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\build\temp.win-amd64-3.7\Release\_libheif_cffi.cp37-win_amd64.lib
    LINK : fatal error LNK1181: cannot open input file 'heif.lib'
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.22.27905\\bin\\HostX86\\x64\\link.exe' failed with exit status 1181

@BiatuAutMiahn
Copy link

Which version pyheif looking for?

@BiatuAutMiahn
Copy link

I agree however your reply is unrelated to this issue.

@BiatuAutMiahn
Copy link

Looking through the source of libheif_build.py I see nothing specific being done other than a call to compile the library. So i'll see if the problem is MSVC 2019, and thus an upstream issue.

@ghost
Copy link

ghost commented Nov 5, 2019

Sorry I only use Mac & Linux for work stuff, not going to make this support Windows.

@ghost ghost closed this as completed Nov 5, 2019
@mexicantexan
Copy link

Any update on this? @BiatuAutMiahn

@Yienschwen
Copy link

Yienschwen commented Jul 26, 2021

The following works on my computer along with virtualenv, and I'm not sure if it's gonna work with anything else ...

  1. Build libheif. I'm using vpckg and it's done simply by vcpkg install libheif:x64-windows.
  2. Try to install pyheif without doing any extra, this should fail.
  3. Find out where setup.py is searching for headers and libraries in error output. Put headers and libraries in directories inside your virtual environment, e.g., <VENV>/include and <VENV>/libs, and copy headers and heif.lib there.
  4. Install pyheif again, and it should pass now
  5. If you are using shared libraries, put libheif and its dependencies next to python executable in your environment, e.g., <VENV>/Scripts/python.exe

image

image

@LaysDragon
Copy link

LaysDragon commented Jan 4, 2022

The following works on my computer along with virtualenv, and I'm not sure if it's gonna work with anything else ...

  1. Build libheif. I'm using vpckg and it's done simply by vcpkg install libheif:x64-windows.
  2. Try to install pyheif without doing any extra, this should fail.
    ...

@Yienschwen Thanks,you save my day. Its works for me on python 3.7.3 venv,also need to copy libde265.dll,libx265.dll to Scripts folder :D

@IavTavares
Copy link

Thanks ;)

This issue was closed.
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

7 participants