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

32-bit CFFI extension build failure on Windows 10 64-bit #30

Closed
anibali opened this issue Sep 12, 2021 · 8 comments
Closed

32-bit CFFI extension build failure on Windows 10 64-bit #30

anibali opened this issue Sep 12, 2021 · 8 comments
Labels

Comments

@anibali
Copy link
Owner

anibali commented Sep 12, 2021

C:\Users\silve>pip install webp
Collecting webp
  Using cached webp-0.1.2.tar.gz (11 kB)
Requirement already satisfied: cffi>=1.0.0 in c:\users\silve\appdata\local\programs\python\python38-32\lib\site-packages (from webp) (1.14.6)
Requirement already satisfied: Pillow>=4.0.0 in c:\users\silve\appdata\local\programs\python\python38-32\lib\site-packages (from webp) (8.3.2)
Requirement already satisfied: numpy>=1.0.0 in c:\users\silve\appdata\local\programs\python\python38-32\lib\site-packages (from webp) (1.21.2)
Requirement already satisfied: pycparser in c:\users\silve\appdata\local\programs\python\python38-32\lib\site-packages (from cffi>=1.0.0->webp) (2.20)
Building wheels for collected packages: webp
  Building wheel for webp (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\silve\appdata\local\programs\python\python38-32\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\silve\\AppData\\Local\\Temp\\pip-install-42g1k2k6\\webp_fb85ab40d19c4d06afd812d2782552ff\\setup.py'"'"'; __file__='"'"'C:\\Users\\silve\\AppData\\Local\\Temp\\pip-install-42g1k2k6\\webp_fb85ab40d19c4d06afd812d2782552ff\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\silve\AppData\Local\Temp\pip-wheel-24nhc3sd'
       cwd: C:\Users\silve\AppData\Local\Temp\pip-install-42g1k2k6\webp_fb85ab40d19c4d06afd812d2782552ff\
  Complete output (85 lines):
  Configuration:
  [settings]
  arch=x86_64
  arch_build=x86_64
  build_type=Release
  compiler=Visual Studio
  compiler.runtime=MD
  compiler.version=14
  os=Windows
  os_build=Windows
  [options]
  [build_requires]
  [env]

  conanfile.txt: Installing package
  Requirements
      libwebp/1.0.3 from 'conancenter' - Cache
  Packages
      libwebp/1.0.3:8353b55c00a74fef4c1485ae46daf301a093802c - Cache

  Installing (downloading, building) binaries...
  libwebp/1.0.3: Already installed!
  conanfile.txt: Generator json created conanbuildinfo.json
  conanfile.txt: Generator txt created conanbuildinfo.txt
  
  ...

build\lib.win32-3.8\_webp.pyd : fatal error LNK1120: 28 unresolved externals
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x86\\link.exe' failed with exit status 1120
  Error in atexit._run_exitfuncs:
  Traceback (most recent call last):
    File "C:\Users\silve\AppData\Roaming\Python\Python38\site-packages\colorama\ansitowin32.py", line 59, in closed
      return stream.closed
  ValueError: underlying buffer has been detached
  ----------------------------------------
  ERROR: Failed building wheel for webp
  Running setup.py clean for webp
Failed to build webp
Installing collected packages: webp
    Running setup.py install for webp ... error
    ERROR: Command errored out with exit status 1:


...


Complete output (85 lines):
    Configuration:
    [settings]
    arch=x86_64
    arch_build=x86_64
    build_type=Release
    compiler=Visual Studio
    compiler.runtime=MD
    compiler.version=14
    os=Windows
    os_build=Windows
    [options]
    [build_requires]
    [env]

    conanfile.txt: Installing package
    Requirements
        libwebp/1.0.3 from 'conancenter' - Cache
    Packages
        libwebp/1.0.3:8353b55c00a74fef4c1485ae46daf301a093802c - Cache

    Installing (downloading, building) binaries...
    libwebp/1.0.3: Already installed!
    conanfile.txt: Generator txt created conanbuildinfo.txt
    conanfile.txt: Generator json created conanbuildinfo.json
    conanfile.txt: Generated conaninfo.txt
    conanfile.txt: Generated graphinfo
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.8
    creating build\lib.win32-3.8\webp
    copying webp\__init__.py -> build\lib.win32-3.8\webp
    creating build\lib.win32-3.8\webp_build
    copying webp_build\builder.py -> build\lib.win32-3.8\webp_build
    copying webp_build\__init__.py -> build\lib.win32-3.8\webp_build
    copying webp_build\cdef.h -> build\lib.win32-3.8\webp_build
    copying webp_build\source.c -> build\lib.win32-3.8\webp_build
    running build_ext
    generating cffi module 'build\\temp.win32-3.8\\Release\\_webp.c'
    creating build\temp.win32-3.8
    creating build\temp.win32-3.8\Release
    building '_webp' extension
    creating build\temp.win32-3.8\Release\build
    creating build\temp.win32-3.8\Release\build\temp.win32-3.8
    creating build\temp.win32-3.8\Release\build\temp.win32-3.8\Release
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133


...


    _webp.obj : error LNK2001: unresolved external symbol _WebPPictureImportRGBA
    _webp.obj : error LNK2001: unresolved external symbol _WebPEncode
    _webp.obj : error LNK2001: unresolved external symbol _WebPInitDecoderConfigInternal
    _webp.obj : error LNK2001: unresolved external symbol _WebPAnimEncoderAdd
    build\lib.win32-3.8\_webp.pyd : fatal error LNK1120: 28 unresolved externals
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x86\\link.exe' failed with exit status 1120
    Error in atexit._run_exitfuncs:
    Traceback (most recent call last):
      File "C:\Users\silve\AppData\Roaming\Python\Python38\site-packages\colorama\ansitowin32.py", line 59, in closed
        return stream.closed
    ValueError: underlying buffer has been detached
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\silve\appdata\local\programs\python\python38-32\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\silve\\AppData\\Local\\Temp\\pip-install-42g1k2k6\\webp_fb85ab40d19c4d06afd812d2782552ff\\setup.py'"'"'; __file__='"'"'C:\\Users\\silve\\AppData\\Local\\Temp\\pip-install-42g1k2k6\\webp_fb85ab40d19c4d06afd812d2782552ff\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\silve\AppData\Local\Temp\pip-record-niqhuezq\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\silve\appdata\local\programs\python\python38-32\Include\webp' Check the logs for full command output.

Originally posted by @FeraruSilviuMarian in #20 (comment)

@anibali
Copy link
Owner Author

anibali commented Sep 12, 2021

@FeraruSilviuMarian Can you please post the full error output? It looks like you've cut out the most important part.

@FeraruSilviuMarian
Copy link

FeraruSilviuMarian commented Sep 13, 2021

C:\Users\silve>pip install webp
Collecting webp
  Using cached webp-0.1.2.tar.gz (11 kB)
Requirement already satisfied: cffi>=1.0.0 in c:\users\silve\appdata\local\programs\python\python38-32\lib\site-packages (from webp) (1.14.6)
Requirement already satisfied: Pillow>=4.0.0 in c:\users\silve\appdata\local\programs\python\python38-32\lib\site-packages (from webp) (8.3.2)
Requirement already satisfied: numpy>=1.0.0 in c:\users\silve\appdata\local\programs\python\python38-32\lib\site-packages (from webp) (1.21.2)
Requirement already satisfied: pycparser in c:\users\silve\appdata\local\programs\python\python38-32\lib\site-packages (from cffi>=1.0.0->webp) (2.20)
Building wheels for collected packages: webp
  Building wheel for webp (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\silve\appdata\local\programs\python\python38-32\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\silve\\AppData\\Local\\Temp\\pip-install-ylv4yu5n\\webp_7fcce4286c634139b34968c038d0f03f\\setup.py'"'"'; __file__='"'"'C:\\Users\\silve\\AppData\\Local\\Temp\\pip-install-ylv4yu5n\\webp_7fcce4286c634139b34968c038d0f03f\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\silve\AppData\Local\Temp\pip-wheel-1grpxpb1'
       cwd: C:\Users\silve\AppData\Local\Temp\pip-install-ylv4yu5n\webp_7fcce4286c634139b34968c038d0f03f\
  Complete output (85 lines):
  Configuration:
  [settings]
  arch=x86_64
  arch_build=x86_64
  build_type=Release
  compiler=Visual Studio
  compiler.runtime=MD
  compiler.version=14
  os=Windows
  os_build=Windows
  [options]
  [build_requires]
  [env]

  conanfile.txt: Installing package
  Requirements
      libwebp/1.0.3 from 'conancenter' - Cache
  Packages
      libwebp/1.0.3:8353b55c00a74fef4c1485ae46daf301a093802c - Cache

  Installing (downloading, building) binaries...
  libwebp/1.0.3: Already installed!
  conanfile.txt: Generator txt created conanbuildinfo.txt
  conanfile.txt: Generator json created conanbuildinfo.json
  conanfile.txt: Generated conaninfo.txt
  conanfile.txt: Generated graphinfo
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win32-3.8
  creating build\lib.win32-3.8\webp
  copying webp\__init__.py -> build\lib.win32-3.8\webp
  creating build\lib.win32-3.8\webp_build
  copying webp_build\builder.py -> build\lib.win32-3.8\webp_build
  copying webp_build\__init__.py -> build\lib.win32-3.8\webp_build
  copying webp_build\cdef.h -> build\lib.win32-3.8\webp_build
  copying webp_build\source.c -> build\lib.win32-3.8\webp_build
  running build_ext
  generating cffi module 'build\\temp.win32-3.8\\Release\\_webp.c'
  creating build\temp.win32-3.8
  creating build\temp.win32-3.8\Release
  building '_webp' extension
  creating build\temp.win32-3.8\Release\build
  creating build\temp.win32-3.8\Release\build\temp.win32-3.8
  creating build\temp.win32-3.8\Release\build\temp.win32-3.8\Release
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\silve\.conan\data\libwebp\1.0.3\_\_\package\8353b55c00a74fef4c1485ae46daf301a093802c\include -Ic:\users\silve\appdata\local\programs\python\python38-32\include -Ic:\users\silve\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-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\shared" "-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\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcbuild\temp.win32-3.8\Release\_webp.c /Fobuild\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_webp.obj
  _webp.c
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\silve\appdata\local\programs\python\python38-32\libs /LIBPATH:c:\users\silve\appdata\local\programs\python\python38-32\PCbuild\win32 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x86" /EXPORT:PyInit__webp build\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_webp.obj C:\Users\silve\.conan\data\libwebp\1.0.3\_\_\package\8353b55c00a74fef4c1485ae46daf301a093802c\lib\webpdecoder.lib C:\Users\silve\.conan\data\libwebp\1.0.3\_\_\package\8353b55c00a74fef4c1485ae46daf301a093802c\lib\webpdemux.lib C:\Users\silve\.conan\data\libwebp\1.0.3\_\_\package\8353b55c00a74fef4c1485ae46daf301a093802c\lib\webpmux.lib C:\Users\silve\.conan\data\libwebp\1.0.3\_\_\package\8353b55c00a74fef4c1485ae46daf301a093802c\lib\webp.lib /OUT:build\lib.win32-3.8\_webp.pyd /IMPLIB:build\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_webp.lib
     Creating library build\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_webp.lib and object build\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_webp.exp
  _webp.obj : error LNK2001: unresolved external symbol _WebPAnimEncoderAssemble
  _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderHasMoreFrames
  _webp.obj : error LNK2001: unresolved external symbol _WebPPictureInitInternal
  _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderGetNext
  _webp.obj : error LNK2001: unresolved external symbol _WebPValidateConfig
  _webp.obj : error LNK2001: unresolved external symbol _WebPMemoryWrite
  _webp.obj : error LNK2001: unresolved external symbol _WebPMemoryWriterClear
  _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderOptionsInitInternal
  _webp.obj : error LNK2001: unresolved external symbol _WebPConfigInitInternal
  _webp.obj : error LNK2001: unresolved external symbol _WebPFree
  _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderNewInternal
  _webp.obj : error LNK2001: unresolved external symbol _WebPFreeDecBuffer
  _webp.obj : error LNK2001: unresolved external symbol _WebPDecode
  _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderGetInfo
  _webp.obj : error LNK2001: unresolved external symbol _WebPGetFeaturesInternal
  _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderReset
  _webp.obj : error LNK2001: unresolved external symbol _WebPPictureImportRGB
  _webp.obj : error LNK2001: unresolved external symbol _WebPPictureFree
  _webp.obj : error LNK2001: unresolved external symbol _WebPAnimEncoderNewInternal
  _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderDelete
  _webp.obj : error LNK2001: unresolved external symbol _WebPAnimEncoderOptionsInitInternal
  _webp.obj : error LNK2001: unresolved external symbol _WebPMemoryWriterInit
  _webp.obj : error LNK2001: unresolved external symbol _WebPPictureAlloc
  _webp.obj : error LNK2001: unresolved external symbol _WebPAnimEncoderDelete
  _webp.obj : error LNK2001: unresolved external symbol _WebPPictureImportRGBA
  _webp.obj : error LNK2001: unresolved external symbol _WebPEncode
  _webp.obj : error LNK2001: unresolved external symbol _WebPInitDecoderConfigInternal
  _webp.obj : error LNK2001: unresolved external symbol _WebPAnimEncoderAdd
  build\lib.win32-3.8\_webp.pyd : fatal error LNK1120: 28 unresolved externals
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x86\\link.exe' failed with exit status 1120
  Error in atexit._run_exitfuncs:
  Traceback (most recent call last):
    File "C:\Users\silve\AppData\Roaming\Python\Python38\site-packages\colorama\ansitowin32.py", line 59, in closed
      return stream.closed
  ValueError: underlying buffer has been detached
  ----------------------------------------
  ERROR: Failed building wheel for webp
  Running setup.py clean for webp
Failed to build webp
Installing collected packages: webp
    Running setup.py install for webp ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\silve\appdata\local\programs\python\python38-32\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\silve\\AppData\\Local\\Temp\\pip-install-ylv4yu5n\\webp_7fcce4286c634139b34968c038d0f03f\\setup.py'"'"'; __file__='"'"'C:\\Users\\silve\\AppData\\Local\\Temp\\pip-install-ylv4yu5n\\webp_7fcce4286c634139b34968c038d0f03f\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\silve\AppData\Local\Temp\pip-record-84jlb461\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\silve\appdata\local\programs\python\python38-32\Include\webp'
         cwd: C:\Users\silve\AppData\Local\Temp\pip-install-ylv4yu5n\webp_7fcce4286c634139b34968c038d0f03f\
    Complete output (85 lines):
    Configuration:
    [settings]
    arch=x86_64
    arch_build=x86_64
    build_type=Release
    compiler=Visual Studio
    compiler.runtime=MD
    compiler.version=14
    os=Windows
    os_build=Windows
    [options]
    [build_requires]
    [env]

    conanfile.txt: Installing package
    Requirements
        libwebp/1.0.3 from 'conancenter' - Cache
    Packages
        libwebp/1.0.3:8353b55c00a74fef4c1485ae46daf301a093802c - Cache

    Installing (downloading, building) binaries...
    libwebp/1.0.3: Already installed!
    conanfile.txt: Generator txt created conanbuildinfo.txt
    conanfile.txt: Generator json created conanbuildinfo.json
    conanfile.txt: Generated conaninfo.txt
    conanfile.txt: Generated graphinfo
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.8
    creating build\lib.win32-3.8\webp
    copying webp\__init__.py -> build\lib.win32-3.8\webp
    creating build\lib.win32-3.8\webp_build
    copying webp_build\builder.py -> build\lib.win32-3.8\webp_build
    copying webp_build\__init__.py -> build\lib.win32-3.8\webp_build
    copying webp_build\cdef.h -> build\lib.win32-3.8\webp_build
    copying webp_build\source.c -> build\lib.win32-3.8\webp_build
    running build_ext
    generating cffi module 'build\\temp.win32-3.8\\Release\\_webp.c'
    creating build\temp.win32-3.8
    creating build\temp.win32-3.8\Release
    building '_webp' extension
    creating build\temp.win32-3.8\Release\build
    creating build\temp.win32-3.8\Release\build\temp.win32-3.8
    creating build\temp.win32-3.8\Release\build\temp.win32-3.8\Release
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\silve\.conan\data\libwebp\1.0.3\_\_\package\8353b55c00a74fef4c1485ae46daf301a093802c\include -Ic:\users\silve\appdata\local\programs\python\python38-32\include -Ic:\users\silve\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-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\shared" "-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\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcbuild\temp.win32-3.8\Release\_webp.c /Fobuild\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_webp.obj
    _webp.c
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\silve\appdata\local\programs\python\python38-32\libs /LIBPATH:c:\users\silve\appdata\local\programs\python\python38-32\PCbuild\win32 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x86" /EXPORT:PyInit__webp build\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_webp.obj C:\Users\silve\.conan\data\libwebp\1.0.3\_\_\package\8353b55c00a74fef4c1485ae46daf301a093802c\lib\webpdecoder.lib C:\Users\silve\.conan\data\libwebp\1.0.3\_\_\package\8353b55c00a74fef4c1485ae46daf301a093802c\lib\webpdemux.lib C:\Users\silve\.conan\data\libwebp\1.0.3\_\_\package\8353b55c00a74fef4c1485ae46daf301a093802c\lib\webpmux.lib C:\Users\silve\.conan\data\libwebp\1.0.3\_\_\package\8353b55c00a74fef4c1485ae46daf301a093802c\lib\webp.lib /OUT:build\lib.win32-3.8\_webp.pyd /IMPLIB:build\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_webp.lib
       Creating library build\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_webp.lib and object build\temp.win32-3.8\Release\build\temp.win32-3.8\Release\_webp.exp
    _webp.obj : error LNK2001: unresolved external symbol _WebPAnimEncoderAssemble
    _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderHasMoreFrames
    _webp.obj : error LNK2001: unresolved external symbol _WebPPictureInitInternal
    _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderGetNext
    _webp.obj : error LNK2001: unresolved external symbol _WebPValidateConfig
    _webp.obj : error LNK2001: unresolved external symbol _WebPMemoryWrite
    _webp.obj : error LNK2001: unresolved external symbol _WebPMemoryWriterClear
    _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderOptionsInitInternal
    _webp.obj : error LNK2001: unresolved external symbol _WebPConfigInitInternal
    _webp.obj : error LNK2001: unresolved external symbol _WebPFree
    _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderNewInternal
    _webp.obj : error LNK2001: unresolved external symbol _WebPFreeDecBuffer
    _webp.obj : error LNK2001: unresolved external symbol _WebPDecode
    _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderGetInfo
    _webp.obj : error LNK2001: unresolved external symbol _WebPGetFeaturesInternal
    _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderReset
    _webp.obj : error LNK2001: unresolved external symbol _WebPPictureImportRGB
    _webp.obj : error LNK2001: unresolved external symbol _WebPPictureFree
    _webp.obj : error LNK2001: unresolved external symbol _WebPAnimEncoderNewInternal
    _webp.obj : error LNK2001: unresolved external symbol _WebPAnimDecoderDelete
    _webp.obj : error LNK2001: unresolved external symbol _WebPAnimEncoderOptionsInitInternal
    _webp.obj : error LNK2001: unresolved external symbol _WebPMemoryWriterInit
    _webp.obj : error LNK2001: unresolved external symbol _WebPPictureAlloc
    _webp.obj : error LNK2001: unresolved external symbol _WebPAnimEncoderDelete
    _webp.obj : error LNK2001: unresolved external symbol _WebPPictureImportRGBA
    _webp.obj : error LNK2001: unresolved external symbol _WebPEncode
    _webp.obj : error LNK2001: unresolved external symbol _WebPInitDecoderConfigInternal
    _webp.obj : error LNK2001: unresolved external symbol _WebPAnimEncoderAdd
    build\lib.win32-3.8\_webp.pyd : fatal error LNK1120: 28 unresolved externals
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x86\\link.exe' failed with exit status 1120
    Error in atexit._run_exitfuncs:
    Traceback (most recent call last):
      File "C:\Users\silve\AppData\Roaming\Python\Python38\site-packages\colorama\ansitowin32.py", line 59, in closed
        return stream.closed
    ValueError: underlying buffer has been detached
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\silve\appdata\local\programs\python\python38-32\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\silve\\AppData\\Local\\Temp\\pip-install-ylv4yu5n\\webp_7fcce4286c634139b34968c038d0f03f\\setup.py'"'"'; __file__='"'"'C:\\Users\\silve\\AppData\\Local\\Temp\\pip-install-ylv4yu5n\\webp_7fcce4286c634139b34968c038d0f03f\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\silve\AppData\Local\Temp\pip-record-84jlb461\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\silve\appdata\local\programs\python\python38-32\Include\webp' Check the logs for full command output.

@anibali anibali changed the title Build error on Windows CFFI extension build failure on Windows 10 Sep 13, 2021
@anibali
Copy link
Owner Author

anibali commented Sep 13, 2021

Are you on a 32-bit or 64-bit version of Windows 10?

@FeraruSilviuMarian
Copy link

FeraruSilviuMarian commented Sep 13, 2021

64-bit operating system, x64-based processor
Windows 10 Pro

my python version is 32 bits, could that be the issue ?

@anibali
Copy link
Owner Author

anibali commented Sep 13, 2021

Yes, I think that might be the issue. I can see a strange blend of 32-bit and 64-bit stuff in the output you posted. The libraries pulled by Conan are 64-bit (to match your system), but then the extension is being compiled in 32-bit (to match your Python), and then they can't be linked.

@anibali
Copy link
Owner Author

anibali commented Sep 13, 2021

You can try the following:

  1. Clone this repo and open a terminal in the root of the project directory.
  2. Checkout my experimental new branch: git checkout python32_on_64
  3. Build 32-bit libwebp binaries using Conan: conan install --build=libwebp -s arch=x86 .
  4. Install pywebp: pip install -U .

@FeraruSilviuMarian
Copy link

I've installed python 3.9.7 64 bit (AMD64) and I was able to install webp after pip installing wheel and some other modules that I had before, thank you for your help.

@anibali anibali changed the title CFFI extension build failure on Windows 10 32-bit CFFI extension build failure on Windows 10 64-bit Sep 13, 2021
@anibali
Copy link
Owner Author

anibali commented Sep 13, 2021

Code has been added to detect when 32-bit Python is installed on an x64 host and configure Conan accordingly: #31

@anibali anibali closed this as completed Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants