适用于 OSX Mountain Lion 上的 Python 3 的 Pygame? [英] Pygame for Python 3 on OSX Mountain Lion?

查看:50
本文介绍了适用于 OSX Mountain Lion 上的 Python 3 的 Pygame?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我几天来一直试图让它工作,但没有运气.我能找到的所有安装演练要么是在使用 python 2.x 的山狮上谈论 pygame,要么是在 osx 10.6 上谈论与 python 3 的 pygame,但从来没有把 3 个都放在一起.

I have been trying to get this to work for days now, with no luck. All of the installation walkthroughs I can find either talk about pygame on mountain lion with python 2.x, or pygame with python 3 on osx 10.6, but never all 3 together.

对不起,如果这很长,但这是我迄今为止尝试过的......

Sorry if this is long, but here's what I've tried so far...

首先我尝试使用自制软件和 pip,如下所示:http://florian-berger.de/en/articles/installing-pygame-for-python-3-on-os-x

First I tried using homebrew and pip, following this: http://florian-berger.de/en/articles/installing-pygame-for-python-3-on-os-x

但是我遇到了这里提到的相同错误:在 Mountain Lion 上安装 Pygame 时出错

But I got the same errors mentioned here: Error when Installing Pygame on Mountain Lion

因此,在对该问题的答案中进行了建议的修改后,我尝试按照 pygame.org 对山狮的说明从源代码编译 pygame:http://www.pygame.org/wiki/MacCompile(但是,这些指令需要 NumPy,我无法获得,因为据我所知,python 3 不存在)

So, having made the modification suggested in the answer to that question, I tried to compile pygame from source, following pygame.org's directions for mountain lion: http://www.pygame.org/wiki/MacCompile (However, those instructions require NumPy, which I couldn't get because as far as I can tell it doesn't exist for python 3)

但我尝试像这样编译它所能得到的最远距离是:

But the furthest I could get with trying to compile it like that was:

In file included from src/imageext.c:51:
/Library/Frameworks/SDL_image.framework/Versions/Current/Headers/SDL_image.h:27:21: error: /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL/SDL.h: Too many levels of symbolic links
/Library/Frameworks/SDL_image.framework/Versions/Current/Headers/SDL_image.h:28:29: error: /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL/SDL_version.h: Too many levels of symbolic links
/Library/Frameworks/SDL_image.framework/Versions/Current/Headers/SDL_image.h:29:28: error: /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL/begin_code.h: Too many levels of symbolic links
/Library/Frameworks/SDL_image.framework/Versions/Current/Headers/SDL_image.h:136:28: error: /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL/close_code.h: Too many levels of symbolic links
src/imageext.c: In function ‘PyInit_imageext’:
src/imageext.c:675: warning: implicit declaration of function ‘PyCObject_Check’
src/imageext.c:675: warning: implicit declaration of function ‘PyCObject_AsVoidPtr’
error: command '/usr/bin/gcc' failed with exit status 1

我是新手,我不知道接下来要尝试什么.(是的,我用谷歌搜索过.我只能确定我有某种符号链接循环,但我不完全知道是什么/在哪里以及如何修复它.)

And newbie that I am, I don't know what to try next. (Yes, I have googled. All I could determine is that I have some kind of symlink loop(s), but what/where and how to fix it I don't exactly know.)

如果有一些非常简单的解决方法可以让你们中的一位聪明人向我指出……那就太好了(即使这让我觉得自己像个白痴!)!

If there is some ridiculously easy fix to this that one of you smart people can point out to me... that would be GREAT (even if it makes me feel like an idiot!)!

失败了,替代策略??我想要的只是在山狮上使用 pygame 和 python 3...如果有人这样做过,我很想听听如何!

Failing that, alternate strategies?? All I want is to use pygame with python 3 on mountain lion... if anyone has done this, I would LOVE to hear how!

附言我显然是新来的,刚刚学习编码......请向我解释事情,就好像我是一个 5 岁的孩子一样.严重地.:)

P.S. I'm obviously new here, and just learning to code... please explain things to me as if I were a 5-year-old. Seriously. :)

推荐答案

我遇到了同样的问题.我刚刚创建了一个 SDL 文件夹并将源文件复制到其中.

I got the same problem. I just created an SDL folder and copied sources files into it.

所以代替:

ln -s SDL .

去:

mkdir SDL; cp *.h SDL

它很丑,但很管用.

这篇关于适用于 OSX Mountain Lion 上的 Python 3 的 Pygame?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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