12

I'm new to Pi and Linux, and I'm using the Pi Zero W with a fresh version of Raspbian installed. I'm trying to get PyGame installed on the Pi so that I can work on a project. When I run the command

pi@raspberrypi:~/pygame $ python setup.py

This is the output:

No Arguments Given, Perform Default Install? [Y/n]y

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

Hunting dependencies...
sh: 1: sdl-config: not found
sh: 1: sdl-config: not found
sh: 1: sdl-config: not found
WARNING: "sdl-config" failed!
Unable to run "sdl-config". Please make sure a development version of SDL is installed.

What does this mean in terms of the Pi? What can I do to fix this (some terminal commands would be great, I have no idea how to use the Debian Package Tracking System)

meabster
  • 123
  • 1
  • 1
  • 4

2 Answers2

15

An easy way to find the package providing a given file is apt-file; you can also do much the same thing online from here. First you need to install apt-file:

> sudo apt install apt-file

After that:

> apt-file search "sdl-config"
emscripten: /usr/share/emscripten/system/bin/sdl-config
libsdl1.2-dev: /usr/bin/sdl-config
libsdl1.2-dev: /usr/share/man/man1/sdl-config.1.gz
lush-library: /usr/share/lush/packages/sdl/sdl-config.lsh

You are almost certainly looking for something in a bin directory with no suffix, since this seems to be an in $PATH executable (since it was "not found" using only a base name), which probably excludes the first entry (since that directory is not in a standard $PATH). A more fine tuned way to do this search would be apt-file search "*/bin/sdl-config", which would give you only those two entries.

Anyway, most likely it is the -dev package, so:

sudo apt install libsdl1.2-dev

Should do it.

goldilocks
  • 60,325
  • 17
  • 117
  • 234
0
apt-file search "sdl-config"
emscripten: /usr/share/emscripten/system/bin/sdl-config
libsdl1.2-dev: /usr/bin/sdl-config
libsdl1.2-dev: /usr/share/man/man1/sdl-config.1.gz
lush-library: /usr/share/lush/packages/sdl/sdl-config.lsh

If you get more than one resulting package from your search, you may inspect the found packages for a description with:

apt-cache show <package-name>

libsdl1.2-dev has been chosen by the user, because emscripten and lush-library may pull several other packages from Java or Lisp. Thats a lot of extra stuff you may never use on your Pi.

Darth Vader
  • 4,218
  • 24
  • 47
  • 70
Andur
  • 11
  • 3