首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >不能安装游戏

不能安装游戏
EN

Stack Overflow用户
提问于 2020-05-19 14:06:20
回答 1查看 3.9K关注 0票数 3

我试图使用命令pip3 install pygame安装一个python包。我使用的是Ubuntu(linux),这就是为什么我使用pip3而不是pip。但是它返回以下错误

代码语言:javascript
代码运行次数:0
运行
复制
Collecting pygame
  Using cached pygame-1.9.6.tar.gz (3.2 MB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-e71p_fru/pygame/setup.py'"'"'; __file__='"'"'/tmp/pip-install-e71p_fru/pygame/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-e71p_fru/pygame/pip-egg-info
         cwd: /tmp/pip-install-e71p_fru/pygame/
    Complete output (29 lines):


    WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
    Using UNIX configuration...

    /bin/sh: 1: sdl-config: not found
    /bin/sh: 1: sdl-config: not found
    /bin/sh: 1: sdl-config: not found
    Package freetype2 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `freetype2.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'freetype2' found
    Package freetype2 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `freetype2.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'freetype2' found
    Package freetype2 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `freetype2.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'freetype2' found
    /bin/sh: 1: freetype-config: not found
    /bin/sh: 1: freetype-config: not found
    /bin/sh: 1: freetype-config: not found

    Hunting dependencies...
    WARNING: "sdl-config" failed!
    WARNING: "pkg-config freetype2" failed!
    WARNING: "freetype-config" failed!
    Unable to run "sdl-config". Please make sure a development version of SDL is installed.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

而且,这种情况不会发生在除吡咯之外的任何软件包中。

我用的是python3.8 3.8和Ubuntu20.04

任何帮助都将不胜感激!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-05-19 14:23:44

许多Linux发行版都有自己的Pygame包。

安装到Ubuntu/Debian/Mint;

代码语言:javascript
代码运行次数:0
运行
复制
sudo apt-get install python3-pygame

安装到Fedora/红色帽子;

代码语言:javascript
代码运行次数:0
运行
复制
sudo yum install python3-pygame
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61893077

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档