繁体   English   中英

在 ubuntu 20.04LTS 上安装 pygame 的问题

[英]Problem to install pygame on ubuntu 20.04LTS

我在 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.

你能帮我吗?

尝试安装它

sudo apt install python3-pygame

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

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

尝试像这样安装:

python3 -m pip install pygame==1.9.5rc2

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM