Python 试图在ubuntu上安装pygame时出错

Python 试图在ubuntu上安装pygame时出错,python,python-3.x,ubuntu,pygame,Python,Python 3.x,Ubuntu,Pygame,我正在尝试使用pip安装pygame,但每当我安装pygame时,我都会收到错误命令“python setup.py egg_info”失败,错误代码为/tmp/pip build hZGMxh/pygame/。在我访问过的网站上,用谷歌搜索上面说的错误来更新setuptools。我这样做了,但它告诉我我已经有了最新的版本。下面是我尝试安装时收到的错误。我需要它使用HyperGAN,所以我不能安装python3-pygame,因为它不是作为pygame安装的,所以我没有安装名为“pygame”的

我正在尝试使用pip安装pygame,但每当我安装pygame时,我都会收到错误
命令“python setup.py egg_info”失败,错误代码为/tmp/pip build hZGMxh/pygame/
。在我访问过的网站上,用谷歌搜索上面说的错误来更新setuptools。我这样做了,但它告诉我我已经有了最新的版本。下面是我尝试安装时收到的错误。我需要它使用
HyperGAN
,所以我不能安装
python3-pygame
,因为它不是作为pygame安装的,所以我没有安装名为“pygame”的模块。非常感谢

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

----------------------------------------
命令“python setup.py egg_info”失败,错误代码为1 /tmp/pip构建hZGMxh/pygame/


最新的pygame没有所有的二进制软件包(又名wheels)。试着安装一个旧的

% pip install pygame==1.9.4
或者按照缺少的依赖项进行安装

% sudo apt install libfreetype6-dev

祝你好运

这是我丢失的包裹。谢谢我还需要
libjpeg-dev-libportmidi-dev-libsdl-image1.2-dev-libsdl-mixer1.2-dev-libsdl-ttf2.0-dev-libsdl1.2-dev-libsmpeg-dev-libx11-dev-libavformat-dev-libswscale-dev