Index ¦ Archives  ¦ Atom  ¦ RSS

pygame - "video system not initialized" error

I got this error every time I tried getting an event in pygame, so I had just put a try-catch and hoped it would go away. Turns out, the init check is done for almost every pygame.key function too so I got stuck. I spent a lot of time on google trying to find the answer, but it turns out the solution was really simple: Recompile for your own architecture. I had been working on one machine, then I rsync'd my code over to work on a network-speaking closer machine since I was testing my program over ssh (with X forwarding). Turns out, I rsync'd the binaries of pygame over as well. They're both x86 and the first machine is much older so the second machine could handle all of its instructions with no problem, but SDL_Init and SDL_WasInitweren't functioning correctly and were outputting this famous quote: pygame.error: video system not initialized I had to install the linux headers (I did the source for good measure) and change some code in pygame to handle more recently linux kernel versions that don't include support for v4l:

sudo apt-get install linux-source libv4l-dev

Then, replace the following line in src/camera.h:

#include <linux/videodev.h>


#include <libv4l1-videodev.h>

© Fahrzin Hemmati. Built using Pelican. Theme by Giulio Fidente on github.