Resolved an error when putting pygame in python3 on raspberry pi

When using 3 series with pyenv on Raspberry Pi, the following error may occur even if you run pygame with 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/

In such a case, follow the steps below to add what you need.

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

After that, I think you can normally do pip install pygame.

Recommended Posts

Resolved an error when putting pygame in python3 on raspberry pi
I got an error when I put opencv in python3 with Raspberry Pi [Remedy]
When you get an error in python scraping (requests)
When I get an error with Pylint in Atom on Windows
Detect "brightness" using python on Raspberry Pi 3!
Adafruit Python BluefruitLE works on Raspberry Pi.
Run servomotor on Raspberry Pi 3 using python
Detect temperature using python on Raspberry Pi 3!
About the error I encountered when trying to use Adafruit_DHT from Python on a Raspberry Pi
Working with GPS on Raspberry Pi 3 Python
Detect slide switches using python on Raspberry Pi 3!
Detect magnet switches using python on Raspberry Pi 3!
Note on encoding when LANG = C in Python
Make DHT11 available on Raspberry Pi + python (memo)
Sound the buzzer using python on Raspberry Pi 3!
To write to Error Repoting in Python on GAE
Error when trying to install psycopg2 in Python
Connect to MySQL with Python on Raspberry Pi
Build a Python development environment on Raspberry Pi
Build an Arch Linux environment on Raspberry Pi
[Python] I want to know the variables in the function when an error occurs!
[python] What to do when an error occurs in send_keys of headless chrome
Use python on Raspberry Pi 3 and turn on the LED when it gets dark!
Build an OpenCV4 environment on Raspberry Pi using Poetry
What to do when python3 type venv does not work well on Raspberry Pi
I get an Import Error in Python Beautiful Soup
pigpio on Raspberry pi
Try debugging Python on Raspberry Pi with Visual Studio.
Note when putting lxml of python package in ubuntu 14.04
What to do if you get an error when importing matplotlib in Python (Mac)
I get an error when I put opencv in pyautoGUI
Use kintone API SDK for Python on Raspberry Pi (easily store data in kintone from Raspberry Pi)
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python
Install pyenv on Raspberry Pi and version control Python
Output to "7-segment LED" using python on Raspberry Pi 3!
Cython on Raspberry Pi
I get an error when I try to raise Python to 3 series using pyenv on Catalina
Check the argument type annotation when executing a function in Python and make an error
When I installed python on macOS and used it, I got an error when I put an https connection
When Runtime Error: maximum recursion depth exceeded while pickling an object appears in python pickle
VScode intellisense doesn't work on Raspberry Pi OS 64bit! (Python)
Run AWS IoT Device SDK for Python on Raspberry Pi
I got an error in vim and zsh in Python 3.7 series
Create an LCD (16x2) game with Raspberry Pi and Python
Detect "temperature (using A / D converter)" using python on Raspberry Pi 3!
Access google spreadsheet using python on raspberry pi (for myself)
Change the message displayed when logging in to Raspberry Pi
Print PDF in Python on Windows: Use an external application
Quicksort an array in Python 3
Install pygame on python3.4 on mac
Raspberry Pi + Python + OpenGL memo
Attention when os.mkdir in Python
Error when playing with python
Slice error in python (´ ; ω ; `)
raspberry pi 1 model b, python
Introduced pyenv on Raspberry Pi
Let's find pi in Python
Use NeoPixel on Raspberry Pi
Install OpenCV4 on Raspberry Pi 3
Install TensorFlow 1.15.0 on Raspberry Pi
I got an error when I tried to process luigi in parallel on windows, but the solution