Where can I find and install the dependencies for pygame?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-29 06:38:20

问题


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.


回答1:


For debian, there is a pre-built package available. See here. You should be able to install it with apt-get or something similar.




回答2:


$ 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




回答3:


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



回答4:


If you run one of supported Linux distributions (see "Unix Distributions" section), you just install pygame from a repository, and dependencies are installed, too.

Generally, you need SDL (libsdl and friends), Python, Numpy.




回答5:


this steps work for me on Ubuntu 16.04:

$ 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

$ sudo pip3 install pygame



回答6:


Mine is Fedora-20, and I found this worked:

sudo yum install python-opengl
sudo yum install python-devel SDL_image-devel SDL_mixer-devel SDL_ttf-devel SDL-devel smpeg-devel numpy subversion portmidi-devel 

Downloaded the smpeg from the website:

http://freecode.com/projects/smpeg

and did a local install:

sudo yum localinstall smpeg-0.4.5-2.1.x86_64.rpm 
sudo yum install pygame pygame-devel


来源:https://stackoverflow.com/questions/7652385/where-can-i-find-and-install-the-dependencies-for-pygame

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!