使用pip安装Python模块时出现奇怪的错误消息

时间:2016-12-29 23:26:24

标签: python macos pip

尝试在Mac上安装pygame时,我遇到了很多错误。我担心这是因为我从各个地方删除了一堆python 2.7文件。 (见最后一个问题)。直到我删除它之后我才意识到这是一件愚蠢的事情。令我困惑的唯一部分是我几天前成功安装了numpy而没有任何问题。如果我有另一种方法可以继续安装模块或解决问题,请提供帮助。运行Mac OSX --Sierra。

sudo pip3 install pygame

Password:
The directory '/Users/kendrick/Library/Caches/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 '/Users/kendrick/Library/Caches/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 pygame
  Downloading pygame-1.9.2.tar.gz (3.0MB)
    100% |████████████████████████████████| 3.0MB 138kB/s 
    Complete output from command python setup.py egg_info:


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

/bin/sh: sdl-config: command not found
/bin/sh: sdl-config: command not found
/bin/sh: sdl-config: command not found
WARNING: "sdl-config" failed!
Hunting dependencies...
SDL     : not found
Framework SDL not found
FONT    : not found
Framework SDL_ttf not found
IMAGE   : not found
Framework SDL_image not found
MIXER   : not found
Framework SDL_mixer not found
Framework CoreMIDI found
Framework QuickTime found
PNG     : not found
JPEG    : not found
PORTMIDI: not found
FREETYPE: found 2.6.1

If you get compiler errors during install, doublecheck
the compiler flags in the "Setup" file.


Continuing With "setup.py"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/tmp/pip-build-03bu0lxv/pygame/setup.py", line 294, in <module>
    write_version_module(METADATA['version'], revision)
  File "/private/tmp/pip-build-03bu0lxv/pygame/setup.py", line 286, in write_version_module
    with open('version.py.in', 'r') as header_file:
FileNotFoundError: [Errno 2] No such file or directory: 'version.py.in'

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

1 个答案:

答案 0 :(得分:0)

这是PyGame版本1.9.2的问题。 包中没有包含一些文件,因此该版本实际上没用。

以下是错误报告的链接: https://bitbucket.org/pygame/pygame/issues/319/missing-versionpyin-in-source-tarball

为完整起见,建议的解决方案是:

  

老鼠,我没有在上传之前检查sdist。在此期间,您可以从Bitbucket下载源代码tarball:   https://bitbucket.org/pygame/pygame/get/1.9.2.tar.gz

相关问题