13

The game is running fine from source code. When I used cx_Freeze to compile the binary file on the Linux I got into error on the second machine:

~/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)

On the machine where I compile the binary it runs fine. Could someone advice me.

Anand S Kumar
  • 88,551
  • 18
  • 188
  • 176
navro
  • 131
  • 1
  • 1
  • 5

1 Answers1

18

Run this : sudo apt-get install libsdl-ttf2.0-0

vwvolodya
  • 2,324
  • 2
  • 20
  • 30
  • 2
    This does not work for me. `libsdl-ttf2.0-0` is already installed – Yanick Rochon Nov 04 '20 at 15:35
  • import pygame.mixer had an issue for me, so this did the trick: sudo apt-get install libsdl2-mixer-2.0-0 – MethodMan Nov 09 '20 at 06:29
  • 13
    @YanickRochon, I had the same issue as you (in that `libsdl-ttf2.0-0` was already installed). This finally did the trick for me: `sudo apt-get install python3-sdl2` – J-L Dec 11 '20 at 00:43