将 Mac 上的 Pygame 安装到 Enthought 版本中 [英] Installing Pygame on Mac into Enthought build

查看:38
本文介绍了将 Mac 上的 Pygame 安装到 Enthought 版本中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Mac 上安装 Pygame 有许多未解决的问题,但我将在这里提出我的具体问题并希望得到答案.

There were a number of unanswered questions on installing Pygame on a Mac but I am going to ask my specific question here and hope for an answer.

我在 Mac 上安装 Pygame 时遇到了难以置信的困难.我使用 Enthought 版本 EPD 7.3-2 32 位,它是我的默认框架,所以如果我在终端提示符下输入 python,我会得到:

I have been having incredible difficulty installing Pygame onto my Mac. I use the Enthought version EPD 7.3-2 32 bit and it is my default framework so if I type python at the terminal prompt I get:

$ python
Enthought Python Distribution (EPD) free version -- www.enthought.com
Version: 7.3-2 (32-bit)

我已经使用 Pip 1.2.1 成功地为这个版本安装了额外的模块,没有任何问题.我的机器上安装了 Xcode 4.5.2,但出现 gcc 错误.

I have successfully installed additional modules to this version using Pip 1.2.1 with no issues. I have Xcode 4.5.2 installed on my machine but I get a gcc error.

有什么想法吗?

这是跟踪:

$ pip install Pygame

Downloading/unpacking Pygame

  Running setup.py egg_info for package Pygame

    warning: no files found matching 'readme.txt'
    no previously-included directories found matching '*/CVS'
    no previously-included directories found matching '*/*/CVS'
Installing collected packages: Pygame
  Running setup.py install for Pygame
    building 'pygame.font' extension
    gcc -fno-strict-aliasing -fno-common -dynamic -arch i386 -DNDEBUG -g -O3 -arch i386 -Ddarwin -I/Library/Frameworks/SDL.framework/Versions/Current/Headers -I/Library/Frameworks/SDL_ttf.framework/Versions/Current/Headers -I/Library/Frameworks/Python.framework/Versions/7.3/include/python2.7 -c src/font.c -o build/temp.macosx-10.5-i386-2.7/src/font.o
    unable to execute gcc: No such file or directory
    error: command 'gcc' failed with exit status 1
    Complete output from command /Library/Frameworks/Python.framework/Versions/7.3/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/var/folders/7p/wns1bszn1gq0zm3z2j_tdkdw0000gn/T/pip-build/Pygame/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/7p/wns1bszn1gq0zm3z2j_tdkdw0000gn/T/pip-478PM0-record/install-record.txt --single-version-externally-managed:
    running install

running build

running build_py

running build_ext

building 'pygame.font' extension

gcc -fno-strict-aliasing -fno-common -dynamic -arch i386 -DNDEBUG -g -O3 -arch i386 -Ddarwin -I/Library/Frameworks/SDL.framework/Versions/Current/Headers -I/Library/Frameworks/SDL_ttf.framework/Versions/Current/Headers -I/Library/Frameworks/Python.framework/Versions/7.3/include/python2.7 -c src/font.c -o build/temp.macosx-10.5-i386-2.7/src/font.o

    unable to execute gcc: No such file or directory

    error: command 'gcc' failed with exit status 1

----------------------------------------
Command /Library/Frameworks/Python.framework/Versions/7.3/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/var/folders/7p/wns1bszn1gq0zm3z2j_tdkdw0000gn/T/pip-build/Pygame/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/7p/wns1bszn1gq0zm3z2j_tdkdw0000gn/T/pip-478PM0-record/install-record.txt --single-version-externally-managed failed with error code 1 in /var/folders/7p/wns1bszn1gq0zm3z2j_tdkdw0000gn/T/pip-build/Pygame
Storing complete log in /Users/jchirico/.pip/pip.log

推荐答案

您是否安装了 Xcode 4.5 的 Command Line Tools 组件?启动 Xcode.app 然后选择 Preferences -> Downloads -> Components 并点击 InstallUpdate.这将在 /usr/bin 等传统位置安装或更新构建工具和系统头文件.

Have you installed the Command Line Tools component of Xcode 4.5? Launch Xcode.app and then select Preferences -> Downloads -> Components and click Install or Update. That will install or update build tools and system headers in the traditional locations like /usr/bin.

这篇关于将 Mac 上的 Pygame 安装到 Enthought 版本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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