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
For debian, you can try usig apt-get to install.
Also make sure you are importing the module using python3 and not python2.
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!
For python 2 try:
For python 3 try: