pursuedpybear: Failed loading libtiff-5.dll: The specified module could not be found.

Simple ppb file

C:\>cat main.py
import ppb
from ppb.features.default_sprites import TargetSprite


ppb.run()

Stack Trace

UserWarning: Using SDL2 binaries from pysdl2-dll 2.0.14
Traceback (most recent call last):
  File "C:\Users\kfmcdani\main.py", line 5, in <module>
    ppb.run()
  File "C:\Users\kfmcdani\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ppb\__init__.py", line 125, in run
    with make_engine(setup, starting_scene=starting_scene, title=title, **engine_opts) as eng:
  File "C:\Users\kfmcdani\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ppb\engine.py", line 276, in __enter__
    self.children.__enter__()
  File "C:\Users\kfmcdani\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ppb\engine.py", line 197, in __enter__
    self._stack.enter_context(system)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\lib\contextlib.py", line 429, in enter_context
    result = _cm_type.__enter__(cm)
  File "C:\Users\kfmcdani\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ppb\systems\renderer.py", line 151, in __enter__
    img_call(IMG_Init, IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF)
  File "C:\Users\kfmcdani\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ppb\systems\sdl_utils.py", line 117, in img_call
    raise SdlError(f"Error calling {func.__name__}: {err.decode('utf-8')}")
ppb.systems.sdl_utils.SdlError: Error calling IMG_Init: Failed loading libtiff-5.dll: The specified module could not be found.

I was able to determine that the missing libtiff-5.dll is in fact in the python site-packages.

c:\<...>\local-packages\Python39\site-packages>ls
PySDL2-0.9.7.dist-info  ppb  ppb-0.12.0.dist-info  ppb_vector  ppb_vector-1.0.dist-info  pysdl2_dll-2.0.14.post1.dist-info  sdl2  sdl2dll
c:\<...>\local-packages\Python39\site-packagesls sdl2dll/dll
SDL2.dll        SDL2_mixer.dll  libfreetype-6.dll  libmpg123-0.dll  libopusfile-0.dll  libvorbis-0.dll      zlib1.dll
SDL2_gfx.dll    SDL2_ttf.dll    libjpeg-9.dll      libogg-0.dll     libpng16-16.dll    libvorbisfile-3.dll
SDL2_image.dll  libFLAC-8.dll   libmodplug-1.dll   libopus-0.dll    libtiff-5.dll      libwebp-7.dll

My best guess is that the sdl_utils.py needs a import sdl2dll. By putting that within sdl_utils.py I was able to get passed this error, but encounter a different one.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

I had the error from python 3.9 from the microsoft store. I then used pyenv for windows to install a different python version and didn’t have any issues importing the libraries