Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to install pygame using pip in a virtualenv. I'm following this tutorial on using Kivy. However, running pip install pygame returns

Downloading/unpacking pygame
Downloading pygame-1.9.1release.tar.gz (2.1MB): 2.1MB downloaded
Running setup.py egg_info for package pygame

WARNING, No "Setup" File Exists, Running "config.py"
Using UNIX configuration...

/bin/sh: 1: sdl-config: not found
/bin/sh: 1: smpeg-config: not found

Hunting dependencies...
WARNING: "sdl-config" failed!
WARNING: "smpeg-config" failed!
Unable to run "sdl-config". Please make sure a development version of SDL is installed.
No files/directories in /tmp/pip-build-root/pygame/pip-egg-info (from PKG-INFO)
Storing complete log in /home/david/.pip/pip.log

The content of /home/david/.pip/pip.log can be found at http://paste.ubuntu.com/5800296/

What am I doing wrong? I'm trying to keep to the standard methodology for installing pygame as much as possible in order to avoid deviating from the tutorial.

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

Try installing the dependencies:

sudo apt-get build-dep python-pygame
sudo apt-get install python-dev

How do I install Pygame in virtualenv?

share|improve this answer
    
After following the instructions in the link, pip install pygame now returns a new error message: paste.ubuntu.com/5801663 –  David Y. Stephenson Jun 26 '13 at 14:31
    
I updated it for now. –  wojox Jun 28 '13 at 1:48
add comment

While wojox answer (from 2013) is correct, I had a difference experience (and solution) that I thought I would share in case someone else comes across this same problem.

I was able to install python-dev without hassle, but I was unable to build-dep python-pygame.

I kept getting:

genUser@mypc:~/downloads/RegExExpress$ sudo apt-get build-dep python-pygame
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: You must put some 'source' URIs in your sources.list

To solve this, I had to go into /etc/apt/sources.list and un-comment the lines in my source that were for deb-src. Example:

## CRUNCHBANG
## Compatible with Debian Wheezy, but use at your own risk.
deb http://packages.crunchbang.org/waldorf waldorf main
#deb-src http://packages.crunchbang.org/waldorf waldorf main

## DEBIAN
deb http://http.debian.net/debian wheezy main contrib non-free
#deb-src http://http.debian.net/debian wheezy main contrib non-free

## DEBIAN SECURITY
deb http://security.debian.org/ wheezy/updates main
#deb-src http://security.debian.org/ wheezy/updates main

(Any line that you see that has #deb-src needs to be uncommented (aka remove the # from the beginning).

If you do not have the src repo in your sources file (i.e. you don't see these lines or something similar in your sources.list file) then you'll have to find the correct src's distro to add; normally you can just add -src to whatever distro's you have listed in your sources.list file and you should be set!

NB: I don't expect that the correct answer will change (nor do I really care =P), but I thought others would want to know that some distros (like in my case: Crunchbang) could be blocking this solution because of these commented lines.

Good luck!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.