尝试在 ubuntu 上安装 pygame 出现错误 [英] Trying to install pygame on ubuntu which gives error

查看:190
本文介绍了尝试在 ubuntu 上安装 pygame 出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 pip 安装 pygame 但无论何时我都会收到错误 Command "python setup.py egg_info" failed with error code 1 in/tmp/pip-build-hZGMxh/pygame/.在我访问过的网站上,谷歌搜索它说更新安装工具的错误.我这样做了,但它告诉我我已经有了最新版本.以下是我尝试安装时收到的错误.我需要它来使用 HyperGAN 所以我不能安装 python3-pygame 因为它没有安装为 pygame 所以我没有安装一个名为pygame"的模块.非常感谢.

dan@dan-VirtualBox:/home$ python -m pip install pygame收集pygame使用缓存的 https://files.pythonhosted.org/packages/ea/00/c8c0432a84fce4061fc9799747ea205805e247c559db1b71ac9f768e38e0/pygame-1.9.4.post1.tar.gz命令 python setup.py egg_info 的完整输出:警告,不存在设置"文件,正在运行config.py"使用 UNIX 配置...在 pkg-config 搜索路径中找不到包 freetype2.也许您应该添加包含freetype2.pc"的目录到 PKG_CONFIG_PATH 环境变量未找到包freetype2"在 pkg-config 搜索路径中找不到包 freetype2.也许您应该添加包含freetype2.pc"的目录到 PKG_CONFIG_PATH 环境变量未找到包freetype2"在 pkg-config 搜索路径中找不到包 freetype2.也许您应该添加包含freetype2.pc"的目录到 PKG_CONFIG_PATH 环境变量未找到包freetype2"sh: 1: freetype-config: 未找到sh: 1: freetype-config: 未找到sh: 1: freetype-config: 未找到狩猎依赖...警告:pkg-config freetype2"失败!警告:freetype-config"失败!SDL:发现 1.2.15字体:找到图片:找到混合器:找到PNG:找到JPEG:找到废料:找到PORTMIDI:找到港口时间:找到自由类型:未找到缺少依赖项---------------------------

<块引用>

命令python setup.py egg_info"失败,错误代码为 1/tmp/pip-build-hZGMxh/pygame/

解决方案

最新的 pygame 没有所有的二进制包(又名轮子).尝试安装一个旧的.

% pip install pygame==1.9.4

或者按照缺少的依赖项进行安装.

% sudo apt install libfreetype6-dev

祝你好运!

I am trying to install pygame using pip but whenever I do I get the error Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-hZGMxh/pygame/. On the sites I have visited googling the errors it says to update setuptools. I do that but it tells me I already have the latest version. Below is the error I receive when I try to install it. I need it to use HyperGAN so I can't install python3-pygame as that is not installed as pygame so I get a no module named "pygame" installed. Many thanks.

dan@dan-VirtualBox:/home$ python -m pip install pygame
Collecting pygame
Using cached https://files.pythonhosted.org/packages/ea/00/c8c0432a84fce4061fc9799747ea205805e247c559db1b71ac9f768e38e0/pygame-1.9.4.post1.tar.gz
Complete output from command python setup.py egg_info:


WARNING, No "Setup" File Exists, Running "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
sh: 1: freetype-config: not found
sh: 1: freetype-config: not found
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

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-hZGMxh/pygame/

解决方案

The latest pygame doesn't have all the binary packages (aka wheels). Try installing an older one.

% pip install pygame==1.9.4

Or follow the missing dependencies and install them.

% sudo apt install libfreetype6-dev

Good luck!

这篇关于尝试在 ubuntu 上安装 pygame 出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆