pip install pygame fails on Ubuntu 12.04

Issue #140 resolved
Jeffrey F
created an issue

On Ubuntu 12.04, I am trying to install pygame in a virtual environment.

sudo aptitude install libsdl1.2-dev libsmpeg-dev libv4l-dev python-virtualenv
virtualenv env -p python2.7
. env/bin/activate
pip install pygame

However, this produces the compilation error:

src/camera.h:42:32: fatal error: linux/videodev.h: No such file or directory

Installing libv4l-dev produces a file at /usr/include/linux/videodev2.h, but linking /usr/include/linux/videodev.h to /usr/include/linux/videodev2.h produces other compilation errors:

src/camera_v4l.c: In function ‘v4l_open_device’:
src/camera_v4l.c:29:29: error: storage size of ‘cap’ isn’t known
src/camera_v4l.c:30:23: error: storage size of ‘buf’ isn’t known
src/camera_v4l.c:51:24: error: ‘VIDIOCGCAP’ undeclared (first use in this function)
src/camera_v4l.c:51:24: note: each undeclared identifier is reported only once for each function it appears in
src/camera_v4l.c:63:26: error: ‘VIDIOCGMBUF’ undeclared (first use in this function)

Comments (10)

  1. Mike Fletcher

    Ubuntu's packages for Pygame have 7 patches, including one that strips support for v4linux 1 (leaving v4linux 2). I expect the package will not build without those applied.

  2. gdorn

    Another horrible hack which works on Mint 17.1 (derived from Ubuntu 14.something):

    cd /usr/include/linux 
    sudo ln -s ../libv4l1-videodev.h videodev.h
  3. Log in to comment