pygame installation: sdl-config command not found

2019-06-04 22:07发布

问题:

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.

回答1:

Try this in the terminal , It should installs the sdl 1.2 # make a temporary directory where we can download and build stuff

mkdir tmp
cd tmp

# download and install SDL
wget http://www.libsdl.org/release/SDL-1.2.14.tar.gz
tar -xzvf SDL-1.2.14.tar.gz
cd SDL-1.2.14
./configure 
sudo make all


回答2:

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

PySDL2 use SDL2