【问题标题】:Python 2.7/3 PyGame InstallationPython 2.7/3 PyGame 安装
【发布时间】:2014-06-17 08:51:00
【问题描述】:

我正在尝试在运行小牛的 Macbook pro 上安装 pygame。

我已按照以下教程安装 pygame: "http://dudeslife.com/blog/2014/programming/installing-python-3-3-3-pygame-on-os-x-mavericks/"

我都按照指示在 python3 和 python 2.7 下安装 pygame。

不幸的是,当我运行“sudo pip install hg+http://bitbucket.org/pygame/pygame”时,我收到以下错误。

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -Ddarwin -D_THREAD_SAFE -DENABLE_NEWBUF=1 -I/usr/X11R6/include -I/usr/local/include/SDL -I/usr/local/include/SDL -I/usr/X11/include -I/usr/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/imageext.c -o build/temp.macosx-10.9-intel-2.7/src/imageext.o

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-fpBwWg-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Nhafjq-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-fpBwWg-build
Storing debug log for failure in /Users/username/Library/Logs/pip.log

根据注释我不能在编译器中设置标志来忽略这个警告,所以我很茫然。我已经尝试安装 Pygame 有一段时间了,如果有任何帮助,我将不胜感激。

最好, 沮丧的初学者 Python 用户

【问题讨论】:

    标签: python macos pygame pip homebrew


    【解决方案1】:

    这是 Apple 对 Xcode 命令行工具的重大更改的结果。对此进行了简要说明here

    不过,一些网站提供了(临时)解决此错误的方法。尝试运行:

    export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
    

    在您的终端中,然后重试安装。如果这不起作用,则可能没有简单的解决方法或解决您的问题。不过,请把你的结果发回来!

    【讨论】:

      猜你喜欢
      • 2012-06-18
      • 1970-01-01
      • 2014-11-19
      • 2015-04-02
      • 2019-09-14
      • 2016-04-03
      • 1970-01-01
      • 2014-03-15
      • 2015-02-28
      相关资源
      最近更新 更多