pygame.error: No available video device

pygame, python

Solution

If you are running Pygame on a UNIX system, like a Linux server, try using a DummyVideoDriver:

import os
os.environ["SDL_VIDEODRIVER"] = "dummy"

Problem

I have this setup: ``` $ python -V Python 2.7.2+ $ python -c "import pygame; print pygame.__version__" 1.9.1release ``` When I run a pygame script, I get this error: ``` Traceback (most recent call last): File "/home/santosh/tmp/pygameHelloWorld.py", line 8, in <module> windowSurface = pygame.display.set_mode((500, 400), 0, 32) pygame.error: No available video device ``` I am using Ubuntu and have install pygame with apt-get. Additionally I have install all dependencies mentioned on this pygame wiki page.

Original source