在哪里可以找到并安装 pygame 的依赖项?

发布于 2024-12-07 18:55:27 字数 465 浏览 0 评论 0原文

我对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

明月松间行 2024-12-14 18:55:27

$ 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 \
  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 \

$ 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 \
明天过后 2024-12-14 18:55:27

看哪,基于 debian 的 dsitros 上最有用的工具之一:

apt-get build-dep python-pygame

安装构建 pygame 所需的所有依赖项:)

在 Fedora 上:

yum-builddep package_name

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
雨后咖啡店 2024-12-14 18:55:27

对于 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.

晚风撩人 2024-12-14 18:55:27

此步骤适用于 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

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
〗斷ホ乔殘χμё〖 2024-12-14 18:55:27

我的 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

东京女 2024-12-14 18:55:27

如果您运行受支持的 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.

晨光如昨 2024-12-14 18:55:27

我(debian buster,python2)最近尝试将 pygame 从 1.9.4 更新到 2.0.2,与此处给出的其他答案相比,似乎已经切换到更新的依赖项,例如来自 libsdl1.2- devlibsdl2-dev

这是我需要安装的 pip2 install --upgrade pygame 才能顺利完成:

sudo apt install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libportmidi-dev

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 to libsdl2-dev.

This is what i needed to install for pip2 install --upgrade pygame to go through without error:

sudo apt install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libportmidi-dev
不必了 2024-12-14 18:55:27

截至目前,在 ubuntu 20.04 上,我遇到了 SDL 缺失错误,并找到了一种解决方案,但结果却遇到了 freetype 错误,然后必须重新安装,因为 python3 pip 命令中的 --user 选项使我无法访问该模块

这是一行适用于我的 python 版本 3.8.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 install libfreetype6-dev && python3 pip -m install -u pygame

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:

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 install libfreetype6-dev && python3 pip -m install -u pygame
暖阳 2024-12-14 18:55:27

我的是 Fedora-20,我发现这有效:

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 

从网站下载 smpeg:

http://freecode.com/ items/smpeg

并进行了本地安装:

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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文