skip to Main Content

I am trying to install pygame with pip3 on Debian GNU/Linux 9. However, once I enter the command sudo pip3 install pygame I get a bunch of missing dependencies:

WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using UNIX configuration...
Hunting dependencies...
WARNING: "pkg-config freetype2" failed!
SDL : found 1.2.15
FONT : not found
IMAGE : not found
MIXER : not found
PNG : found
JPEG : not found
SCRAP : found
PORTMIDI: not found
PORTTIME: not found
FREETYPE: found 2.6.3
Missing dependencies

After this I used apt to install python-pygame, because I thought that contained all of the dependencies I needed. However, I still can’t import pygame, and if I run pip3 install again, I get the same errors. Does anyone know how to fix this?

3

Answers


  1. For debian, you can try usig apt-get to install.

    sudo apt-get install python3-pygame
    

    Also make sure you are importing the module using python3 and not python2.

    Login or Signup to reply.
  2. not certain of my answer, and with <50 rep, I am not allowed to comment, so I will take a shot at an answer, which may not be correct. I believe that ‘sudo pip3’ is not the right way to install PyPI packages, since that will install them for root, and not for your user. I think you want to use just ‘pip3’ (that is working for me). If you need to use sudo, you might try ‘sudo -H pip3’, which should put them in the right place (if you need to use sudo – you should not need it for python3 package installs AFAIK)…

    This helped me: https://linuxize.com/post/how-to-install-pip-on-ubuntu-18.04/

    Hope that helps!

    Login or Signup to reply.
  3. For python 2 try:

    sudo apt-get install python-pygame
    

    For python 3 try:

    sudo apt-get install python3-pygame
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search