UPDATE 1: I uninstalled, reinstalled, and followed the instructions on the Pygame website for installing dependencies/building Pygame. It turns out I'm missing dependencies, as Python indicates when I attempt to run the setup.py script:
SDL : found 1.2.15
FONT : not found
IMAGE : not found
MIXER : not found
SMPEG : found 0.4.5
PNG : not found
JPEG : not found
SCRAP : not found
PORTMIDI: found
PORTTIME: found
I have a list elsewhere of what corresponds the what missing package. My question is: what environment variable will I need to modify in order to get these packages detected? (and, when doing so, what will I need to provide? the shared object file for each of these?)
EDIT: System details - Linux Mint 17.2 Cinnamon 64-bit. Cinnamon version: 2.6.13. Graphics card: Intel Corporation Broadwell-U Integrated Graphics. 7.7 GiB Memory, i5 processor.
I am trying to get pygame up and running on my new device to make some games. I installed libSDL, and pygame more recently; after trying to run three different games others have made, I keep running into the same error:
>~/Downloads/bubble $ python run.py
Traceback (most recent call last):
File "run.py", line 2, in <module>
from classes.game import *
File "/home/---/Downloads/bubble/classes/game.py", line 2, in <module>
from .arrow import *
File "/home/---/Downloads/bubble/classes/arrow.py", line 1, in <module>
from .constantes import *
File "/home/---/Downloads/bubble/classes/constantes.py", line 35, in <module>
scr = display.set_mode(screen.size)
pygame.error: No available video device
What I did to look into the issue/try to resolve it:
1) Double checked I have libSDL and the corresponding dev packages installed. [after researching that one cause of this error is not having libSDL installed]
>~aptitude search sdl | grep -F 'i '
i A libalien-sdl-perl - helper to get, build and use SDL libraries
i A libsdl-console - Console that can be added to any SDL appli
i libsdl-console-dev - Console that can be added to any SDL appli
i A libsdl-gfx1.2-4 - drawing and graphical effects extension fo
i libsdl-gst - SDL bindings for GNU Smalltalk
i libsdl-image-gst - SDL_image bindings for GNU Smalltalk
i libsdl-image1.2 - Image loading library for Simple DirectMed
i libsdl-image1.2:i386 - Image loading library for Simple DirectMed
i A libsdl-image1.2-dev - Image loading library for Simple DirectMed
i libsdl-mixer-gst - SDL_mixer bindings for GNU Smalltalk
i A libsdl-mixer1.2 - Mixer library for Simple DirectMedia Layer
i libsdl-mixer1.2:i386 - Mixer library for Simple DirectMedia Layer
i A libsdl-net1.2 - Network library for Simple DirectMedia Lay
i libsdl-net1.2:i386 - Network library for Simple DirectMedia Lay
i libsdl-net1.2-dbg - Network library for Simple DirectMedia Lay
i libsdl-net1.2-dev - Network library for Simple DirectMedia Lay
i A libsdl-pango1 - text rendering with Pango in SDL applicati
i libsdl-perl - SDL bindings for the Perl language
i A libsdl-sge - extension of graphic functions for SDL mul
i libsdl-sge-dev - extension of graphic functions for the SDL
i libsdl-sound-gst - SDL_sound bindings for GNU Smalltalk
i A libsdl-sound1.2 - Sound library for Simple DirectMedia Layer
i libsdl-ttf-gst - SDL_ttf bindings for GNU Smalltalk
i A libsdl-ttf2.0-0 - TrueType Font library for Simple DirectMed
i libsdl-ttf2.0-0:i386 - TrueType Font library for Simple DirectMed
i libsdl-ttf2.0-dev - TrueType Font library for Simple DirectMed
i A libsdl1.2-dev - Simple DirectMedia Layer development files
i libsdl1.2debian - Simple DirectMedia Layer
i libsdl1.2debian:i386 - Simple DirectMedia Layer
i A libsdl2-2.0-0 - Simple DirectMedia Layer
i libsdl2-dbg - Simple DirectMedia Layer debug files
i libsdl2-dev - Simple DirectMedia Layer development files
i libsdl2-gfx-1.0-0 - drawing and graphical effects extension fo
i libsdl2-gfx-dbg - debugging symbols for SDL2_gfx
i libsdl2-gfx-dev - development files for SDL2_gfx
i libsdl2-gfx-doc - documentation files for SDL2_gfx
i libsdl2-image-2.0-0 - Image loading library for Simple DirectMed
i libsdl2-image-dbg - Image loading library for Simple DirectMed
i libsdl2-image-dev - Image loading library for Simple DirectMed
i libsdl2-mixer-2.0-0 - Mixer library for Simple DirectMedia Layer
i libsdl2-mixer-dbg - Mixer library for Simple DirectMedia Layer
i libsdl2-mixer-dev - Mixer library for Simple DirectMedia Layer
i libsdl2-net-2.0-0 - Network library for Simple DirectMedia Lay
i libsdl2-net-dbg - Network library for Simple DirectMedia Lay
i libsdl2-net-dev - Network library for Simple DirectMedia Lay
i libsdl2-ttf-2.0-0 - TrueType Font library for Simple DirectMed
i libsdl2-ttf-dbg - TrueType Font library for Simple DirectMed
i libsdl2-ttf-dev - TrueType Font library for Simple DirectMed
2) Ensured I had the appropriate envvar for SDL_VIDEODRIVER set. [after researching another post, indicating that this variable needs to be set or pygame will not work properly]
>~set | grep 'SDL'
SDL_VIDEODRIVER=x11
[To add to the former: I ran a simple compiled .c file demonstrating a window with image rendered on it in libSDL, and that works just fine!]
After double checking libSDL is installed/envvar for the driver is set, this particular error persists for three different games I downloaded from the pygame site. I'm pretty stumped at this point, and would appreciate any help on how resolve this and get pygame working. Many thanks for your time.
See Question&Answers more detail:
os