【问题标题】:Problem to install pygame on ubuntu 20.04LTS在 ubuntu 20.04LTS 上安装 pygame 的问题
【发布时间】:2020-10-01 12:01:57
【问题描述】:

我在 Ubuntu 20.04LTS 上,我尝试为学校项目安装 pygame(用于 python)。但是当我尝试这个时:

sudo pip3 install pygame

我收到一个错误:

ERROR: Command errored out with exit status 1:
 command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-szdn6q_u/pygame/setup.py'"'"'; __file__='"'"'/tmp/pip-install-szdn6q_u/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-pip-egg-info-3fqnujta
     cwd: /tmp/pip-install-szdn6q_u/pygame/
Complete output (18 lines):


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


Hunting dependencies...
SDL     : found 1.2.15
FONT    : not found
IMAGE   : not found
MIXER   : not found
PNG     : found
JPEG    : found
SCRAP   : found
PORTMIDI: not found
PORTTIME: not found
FREETYPE: found 23.1.17
Missing dependencies
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

你能帮帮我吗?

【问题讨论】:

    标签: python python-3.x pygame ubuntu-20.04


    【解决方案1】:

    尝试安装它

    sudo apt install python3-pygame
    

    相反。您收到的错误是因为您缺少 Pygame 依赖项,应该为您安装它。

    作为一般规则,最好通过包管理器安装 Python 包,并仅在它们不可用时使用 pip。

    【讨论】:

      【解决方案2】:

      尝试这样安装:

      python3 -m pip install pygame==1.9.5rc2

      我遇到了同样的问题,效果很好。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-02-28
        • 1970-01-01
        • 2020-09-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-07-15
        • 1970-01-01
        相关资源
        最近更新 更多