python - Pygame:导入错误:libSDL_ttf-2.0.so.0:无法打开共享对象文件:没有这样的文件或目录

标签 python linux pygame sdl cx-freeze

游戏从源代码运行良好。当我在 Linux 上使用 cx_Freeze 编译二进制文件时,我在第二台机器上遇到了错误:

~/tmp/exe.linux-x86_64-2.7 $ ./rungame
/home/local/tmp/exe.linux-x86_64-2.7/library.zip/lib/MenuItem.py:13:   RuntimeWarning: use font: libSDL_ttf-2.0.so.0: cannot open shared object file: No such file or directory
(ImportError: libSDL_ttf-2.0.so.0: cannot open shared object file: No such file or directory)
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/cx_Freeze/initscripts/Console.py", line 27, in <module>
File "rungame.py", line 10, in <module>
File "/lib/gameloop.py", line 13, in <module>
File "/lib/settings.py", line 10, in <module>
File "/lib/menuitem.py", line 13, in <module>
File "/usr/lib64/python2.7/site-packages/pygame/__init__.py", line 74, in __getattr__
NotImplementedError: font module not available
(ImportError: libSDL_ttf-2.0.so.0: cannot open shared object file: No such file or directory)

在我编译二进制文件的机器上运行良好。有人可以给我建议吗。

最佳答案

运行:sudo apt-get install libsdl-ttf2.0-0

关于python - Pygame:导入错误:libSDL_ttf-2.0.so.0:无法打开共享对象文件:没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31716754/

相关文章:

python - 从文本文件的数据中计算平均值

python - 为什么函数(Python)的 __code__ 是可变的

linux - 如何在 Bash 中给定的实际运行时间后终止进程?

python - 在显示更新之间使用 pygame.time.wait()

python - 修复 "ModuleNotFoundError: No module named ' fsns'"in google colab for Attention ocr

Python popen() - 通信(str.encode(编码 ="utf-8",错误 ="ignore"))崩溃

linux - 链接器找不到符号,但已读取库且存在符号

php - 如何使用 PHP 判断文件是否为文本?

python - 尝试从 pygame.midi 继承时出错

python - 致命的 Python 错误 : (pygame parachute) Segmentation Fault Aborted