ラズパイ上のpyenvなどで3系を使用している際、pygameをpip install pygame
でやっても以下のようなエラーになることがあります。
Collecting pygame
Using cached pygame-1.9.3.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "config.py"
Using UNIX configuration...
/bin/sh: 1: sdl-config: not found
/bin/sh: 1: sdl-config: not found
/bin/sh: 1: sdl-config: not found
Hunting dependencies...
WARNING: "sdl-config" failed!
Unable to run "sdl-config". Please make sure a development version of SDL is installed.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-vvaj67he/pygame/
そんな時は以下手順で必要なものを入れましょう。
sudo apt-get install libsdl-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev
sudo apt-get install libsmpeg-dev libportmidi-dev libavformat-dev libswscale-dev
あとは普通にpip install pygame
でいけると思います。