Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find and install the dependencies for pygame?

I am relatively new to linux and am trying to install the pygame dev environment for python. When I run the setup.py it says that I need to install the following dependencies, one of which I found and installed (SDL). However, the others have been more elusive.

Hunting dependencies... sh: smpeg-config: command not found WARNING: "smpeg-config" failed! SDL     : found 1.2.14 FONT    : not found IMAGE   : not found MIXER   : not found SMPEG   : not found PNG     : not found JPEG    : not found SCRAP   : found PORTMIDI: not found PORTTIME: not found 

If you could give me some guidance I would appreciate it.

Thank you.

like image 686
Andy Avatar asked Oct 04 '11 18:10

Andy


People also ask

How do I import imports into pygame?

Open a terminal, and type 'sudo apt-get install idle pygame', enter your password and type 'y' at the prompts, if necessary. 2. After the installation completes, enter 'python' in the terminal to launch Python. Verify that it's using version 2.7 or newer, then at the Python prompt enter 'import pygame'.

Where does pygame install?

Go to the Pygame downloads page and download the mac installer. Run it, and it should install Pygame on your Mac. Now run Python in your terminal and try import pygame . If it does not say anything, it's installed successfully.

Does Python 3.10 support pygame?

Python doesn't support Pygame.


2 Answers

$ sudo apt-get install python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev

Or sorted slightly:

sudo apt-get install \   python-dev \   python-numpy \   subversion \   ffmpeg \   libsdl1.2-dev \   libsdl-image1.2-dev \   libsdl-mixer1.2-dev \   libsdl-ttf2.0-dev \   libavcodec-dev \   libavformat-dev \   libportmidi-dev \   libsmpeg-dev \   libswscale-dev \ 
like image 158
kiranmathewkoshy Avatar answered Oct 03 '22 21:10

kiranmathewkoshy


Behold, one of the most useful tools on debian-based dsitros:

apt-get build-dep python-pygame 

Installs all the dependences required to build pygame :)

On Fedora:

yum-builddep package_name 
like image 26
GuySoft Avatar answered Oct 03 '22 21:10

GuySoft