22
25

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

raspberry pi上のpython3にpygameを入れる際のエラーを解決

Posted at

ラズパイ上の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でいけると思います。

22
25
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
25

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?