I'm trying to install some software packages, but i keep getting errors

So I’m using the RPi SD card build you guys have. And I’m trying to install pygame so i used:
sudo apt-get install python3-pygame
and i got:
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package python3-pygame is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3-pygame' has no installation candidate

so I used pip by doing:
sudo pip3 install pygame
and I got:
Collecting pygame
Using cached
https://files.pythonhosted.org/packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c8094d6441db2be/pygame-1.9.6.tar.gz
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-pr6c9vyu/pygame/setup.py’"’"’; file=’"’"’/tmp/pip-install-pr6c9vyu/pygame/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-pr6c9vyu/pygame/
Complete output (13 lines):

    WARNING, No "Setup" File Exists, Running "buildconfig/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!
    WARNING: "pkg-config freetype2" failed!
    Unable to run "sdl-config". Please make sure a development version of SDL is installed.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I later used the sudo -H flag and got the same result except the warning at the beginning. Most of the things are up to date, I managed to connect to internet and not the access point. I upgraded setuptools, pip3, build-essentials and a lot more other stuff and I honestly don’t know where the problem is. If someone could help me out, advise me on what to install in order to fix this this it would be really great, thank you.

edit: apologies for some of the messed up preformatted terminal text

I’m having the exact same issue. Did you get any further?

where is setup.py supposed to be?

python3-pygame is not something we use on the platform for our Magni robot.
Good luck in your experiment.
Do you feel the pygame module would be of importance for robotic platforms?
Thank You,
Mark

Sorry for getting to this so late.

To install pygame from pip3 you need to install all the C dependencies manually in order for pip to be able to build it.

sudo apt-get install git python3-dev python3-setuptools python3-numpy python3-opengl \
    libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev \
    libsdl1.2-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev \
    libtiff5-dev libx11-6 libx11-dev fluid-soundfont-gm timgm6mb-soundfont \
    xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic fontconfig fonts-freefont-ttf libfreetype6-dev
1 Like

Hello, I would like to thank you, the information brought was of great importance, I speak here from Brazil, and I would like to express my gratitude for the great help you have given me.

1 Like

You really have been a great help. As to mjstn2011, you do realize that after reading all different threads, that you sir come off as sharp and hard to deal with. Stop trying to stick it to your customers with your hard ass points.:wink:
Let your techs do there thing. I should pm this but you need to hear it.