革文 、 2020-07-24 10:49 采纳率: 0%
浏览 589

Ubuntu 20.04 LTS 安装pygame报错,求大佬指教,谢谢

root@ubuntu:~# python3 -m pip install -U pygame --user
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-j30fi9nk/pygame/setup.py'"'"'; file='"'"'/tmp/pip-install-j30fi9nk/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-xv8blbld
cwd: /tmp/pip-install-j30fi9nk/pygame/
Complete output (35 lines):

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

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: "pkg-config freetype2" failed!
WARNING: "freetype-config" failed!
SDL     : found 1.2.15
FONT    : found
IMAGE   : found
MIXER   : found
PNG     : found
JPEG    : found
SCRAP   : found
PORTMIDI: found
PORTTIME: found
FREETYPE: not found
Missing dependencies
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我使用了多种方法安装pygame,都失败了,都是这种报错,求大佬帮帮忙,谢谢!

  • 写回答

2条回答 默认 最新

  • qq_39254473 2020-07-27 10:21
    关注
    sudo apt-get install git python3-dev python3-setuptools python3-numpy python3-opengl \
         libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev \
         libsdl1.2-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev \
         libtiff5-dev libx11-6 libx11-dev fluid-soundfont-gm timgm6mb-soundfont \
         xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic fontconfig fonts-freefont-ttf libfreetype6-dev
    

    安装pygame依赖,详情见pygame官网http://www.pygame.org/wiki/CompileUbuntu

    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效