安装 python 包时显示“命令“python setup.py egg_info”失败”?

安装 python 包时显示“命令“python setup.py egg_info”失败”?

我想安装 python 包“pygame”。使用 python3.5,我首先安装以下内容:

$ sudo apt-get install python3.5-dev mercurial
$ sudo apt-get install libsdl-image1.2-dev libsdl2-dev libsdl-ttf2.0-dev
$ pip3 install --user hg+http://bitbucket.org/pygame/pygame

它显示了这些:

    The directory '/home/omou/.cache/pip/http' or its parent directory 
is not owned by the current user and the cache has been disabled. 
Please check the permissions and owner of that directory. If executing 
pip with sudo, you may want sudo's -H flag.
The directory '/home/omou/.cache/pip' or its parent directory is not 
owned by the current user and caching wheels has been disabled. check 
the permissions and owner of that directory. If executing pip with 
sudo, you may want sudo's -H flag.
Collecting hg+http://bitbucket.org/pygame/pygame
  Cloning hg http://bitbucket.org/pygame/pygame to /tmp/pip-7bSGiX-
build
Complete output from command python setup.py egg_info:


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

sh: 1: freetype-config: not found
sh: 1: freetype-config: not found
sh: 1: freetype-config: not found

Hunting dependencies...
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-7bSGiX-build/

我已经尝试了很多方法,但都没有解决。请有人告诉我发生了什么事以及如何解决它。

答案1

从输出结果可以看出,你不是安装 pip 的人。也许你应该换一个账户来使用 pip。或者使用 sudo 来提升权限。

相关内容