Issue #48 resolved

ImportError: found [''], but it's not usable for the libary SDL2_ttf

Anonymous created an issue

This error: ImportError: found [''], but it's not usable for the libary SDL2_ttf

happens as soon as I try to import the ttf library: import sdl2.sdlttf

Is there any way to find out why the library is not usable?

I'm running Ubuntu 12.04, python3.2, and SDL2 (v2.0.1-7893) and SDL2_ttf (v2.0.12) were compiled from source

Comments (5)

  1. Marcus von Appen repo owner

    This can happen, if one runs a 32-bit python and uses 64-bit SDL2 libraries (or the other way around). Did you ensure that both, Python and your SDL2 libraries use the same bit count?

  2. Mike C

    Both are 64bit.

    I was able to determine the issue, and that wasn't it. Both libSDL2 and libSDL2_ttf were installed to /usr/local/lib, which is the default for the configure scripts when built from source. I guess this allowed the dll loader ( to know that I had it installed, but not where it was installed to.

    There were warnings that I was not aware of (I guess maybe there's a switch I need to set to show them?), so I changed the code in to print the warning instead, and it gave me: OSError(' cannot open shared object file: No such file or directory',)

    That was enough for me to figure out the issue.

    So the original issue is all set, and I can chalk that up to me installing from source and/or not having paths correct.

    I understand making the library checks warnings, as it could have failures that would get annoying if they show up every time, but maybe after the warning checks, and if it throws a full on error, it shows you all of the warnings in addition to the RuntimeError that's thrown? The exception that's raised, "found %s, but it's not usable for the libary %s", doesn't do much to help troubleshoot the issue in and of itself.

    I'm referencing, lines 50-65

    (there's also a typo in the exception; should be library and not libary, but I think that's already been posted as a separate issue)

  3. Mike C

    I was using 0.8.0 at the time. I just upgraded to 0.9.0 and still just go the error (once I uninstalled SDL_ttf)

    I thought it might be the IDE (PyCharm) hiding the warnings, but I ran it in a termal and still only got the error message and no warnings

  4. Log in to comment