我已成功导入最新上游版本的 sdl2.sdlgfx。
当我要导入 sdl2.sdlgfx 时,导入失败。如果您导入成功,请评论如何操作。
我尝试如下。
$ python3
Python 3.11.2 (main, May 30 2023, 17:45:26) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sdl2.sdlgfx
/usr/lib/python3/dist-packages/sdl2/dll.py:234: DLLWarning: TypeError("'<' not supported between instances of 'int' and 'tuple'")
warnings.warn(repr(exc), DLLWarning)
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/sdl2/sdlgfx.py", line 53, in <module>
dll = DLL("SDL2_gfx", ["SDL2_gfx", "SDL2_gfx-1.0"],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/sdl2/dll.py", line 236, in __init__
raise RuntimeError("found %s, but it's not usable for the library %s" %
RuntimeError: found ['libSDL2_gfx-1.0.so.0'], but it's not usable for the library SDL2_gfx
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/sdl2/sdlgfx.py", line 56, in <module>
raise ImportError(exc)
ImportError: found ['libSDL2_gfx-1.0.so.0'], but it's not usable for the library SDL2_gfx
>>>
环境:
- Ubuntu 23.04
- 包
- libsdl2-2.0-0、libsdl2-gfx-1.0-0、libsdl2-image-2.0-0、libsdl2-mixer-2.0-0、libsdl2-ttf-2.0-0、python3-sdl2
答案1
使用最新的上游版本导入 sdl2.sdlgfx。