Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pygame installation: sdl-config command not found

I used

./configure --prefix=$HOME
make
make install

to install sdl2, after which I tried to install pygame by

cd ../pygame-1.9.1release/
python setup.py install

but I am getting an error:

linuxnx:~/python/library/pygame-1.9.1release> python setup.py install
WARNING, No "Setup" File Exists, Running "config.py"
Using UNIX configuration...
Hunting dependencies...
sh: sdl-config: command not found
WARNING: "sdl-config" failed!
sh: smpeg-config: command not found
WARNING: "smpeg-config" failed!
Unable to run "sdl-config". Please make sure a development version of SDL is installed.
like image 670
user2918138 Avatar asked Oct 25 '13 01:10

user2918138


2 Answers

I searched a long time, cause I needed the package for Python Crash Course by Eric Matthes, but couldn't find the answer that would help running pip install pygame without errors and finally found 1 line solution that worked for me

sudo apt-get install python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev libfreetype6-dev
like image 78
EakzIT Avatar answered Sep 27 '22 15:09

EakzIT


ORIGINAL: 2013.10.25

PyGame-1.9.1 was created in 2009 so it still use old SDL 1.2 not new SDL2.

PySDL2 use SDL2


EDIT: 2021.10.17

Question and my original answer is almost 8 years old and it seems author removed PySDL2 from URL in my old answer. He moved code from bitbucket to github

Using Google I found

  • doc: https://pysdl2.readthedocs.io/
  • pypi: https://pypi.org/project/PySDL2/
  • github: https://github.com/marcusva/py-sdl2

And meanwhile PyGame started to use SDL2.

  • Pygame.org: pygame 2 — 28 Oct, 2020
  • GitHub: Release note

See also all releases

like image 21
furas Avatar answered Sep 27 '22 15:09

furas