在哪里可以找到并安装 pygame 的依赖项?
我对 Linux 比较陌生,正在尝试安装 python 的 pygame 开发环境。当我运行 setup.py 时,它说我需要安装以下依赖项,我找到并安装了其中之一(SDL)。然而,其他人则更加难以捉摸。
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
如果您能给我一些指导,我将不胜感激。
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
$ 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 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:
看哪,基于 debian 的 dsitros 上最有用的工具之一:
安装构建 pygame 所需的所有依赖项:)
在 Fedora 上:
Behold, one of the most useful tools on debian-based dsitros:
Installs all the dependences required to build pygame :)
On Fedora:
对于 debian,有一个可用的预构建包。请参阅此处。您应该能够使用 apt-get 或类似的东西来安装它。
For debian, there is a pre-built package available. See here. You should be able to install it with
apt-get
or something similar.此步骤适用于 Ubuntu 16.04:
this steps work for me on Ubuntu 16.04:
我的 Arch Linux 列表:
sudo pacman -Sy sdl_ttf sdl_sound sdl_image sdl_mixer portmidi
My list for Arch Linux:
sudo pacman -Sy sdl_ttf sdl_sound sdl_image sdl_mixer portmidi
如果您运行受支持的 Linux 发行版之一(请参阅“Unix 发行版”部分),您只需从存储库和依赖项也已安装。
一般来说,您需要 SDL(libsdl 和朋友)、Python、Numpy。
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.
我(debian buster,python2)最近尝试将 pygame 从 1.9.4 更新到 2.0.2,与此处给出的其他答案相比,似乎已经切换到更新的依赖项,例如来自
libsdl1.2- dev
到libsdl2-dev
。这是我需要安装的
pip2 install --upgrade pygame
才能顺利完成:I (debian buster, python2) recently tried to update pygame from 1.9.4 to 2.0.2, and it seems there has been a switch to newer dependencies compared to the other answers given here, for example from
libsdl1.2-dev
tolibsdl2-dev
.This is what i needed to install for
pip2 install --upgrade pygame
to go through without error:截至目前,在 ubuntu 20.04 上,我遇到了 SDL 缺失错误,并找到了一种解决方案,但结果却遇到了 freetype 错误,然后必须重新安装,因为 python3 pip 命令中的 --user 选项使我无法访问该模块
这是一行适用于我的 python 版本 3.8.2 的解决方案:
on ubuntu 20.04 as of this date I had the SDL missing error and found a solution only to run into a freetype error then had to reinstall because the --user option in the python3 pip command kept me from accessing the module
Here is a one line solution that worked for me with python version 3.8.2:
我的是 Fedora-20,我发现这有效:
从网站下载 smpeg:
http://freecode.com/ items/smpeg
并进行了本地安装:
Mine is Fedora-20, and I found this worked:
Downloaded the smpeg from the website:
http://freecode.com/projects/smpeg
and did a local install: