本文介绍了Pygame for Python 3.2 on mac - 导入错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在我的macbook pro上安装pygame模块运行snow leapord。我正在运行的python版本是3.2

I have been attempting to install the pygame module on my macbook pro running snow leapord. the python version i am running on is 3.2

我一直在遵循是为了从源代码构建和安装模块。运行构建时
我多次收到以下警告:

I have been following instructions from here in order to build and install the module from source.when running the build i get the following warning many times:

引用:


当运行python IDLE时,我可以看到pygame模块列为可用模块上的

when running the python IDLE i am able see the pygame module listed as on of the available modules

但是当我尝试导入模块时我收到以下信息:

but when i try to import the module i receive the following:

引用:


我假设这个我某种链接问题,但我不知道如何解决它...非常感谢任何想法,因为我没有任何编程bg。

I am assuming that this is some sort of linking issue but i do not know how to approach solving it... would very much appreciate any thought as i do not have any programming bg whatsoever.

我只是尝试了迈克尔的答案,但收到了以下(新)错误:

I just tried Michael's answer out but received the following (new) error:



任何想法?

推荐答案

你那里有一台花哨的电脑,巴瓦佐斯你所拥有的指令(大约在2009年)对64位架构(或32位与64位通用版本和库)没有任何关系,现在这是开发人员必须关注的一个考虑因素。

You have a fancy computer there, Barvazos. And the instructions you have there (circa 2009) say nothing about 64-bit architectures (or 32 bit versus 64 bit universal builds & libraries), which is now a consideration that developers have to care about these days.

如果这是我的问题,我第一次尝试解决这个问题就是改变保罗巴里的说明书(你在你的问题中链接到)的第6步说:

If this were my problem, my first attempt to fix this would be to change "Step 6" on Paul Barry's instruction sheet (which you linked to in your question) to say:

export CC='/usr/bin/gcc-4.2' CFLAGS='-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64'

(如果不清楚,我添加到该步骤的东西6行是 -arch x86_64 位)

(in case it's not clear, the thing that I added to that Step 6 line is the -arch x86_64 bit)

如果这确实是解决方案,那么e-邮寄该说明书的作者并告诉他更新该PDF文件与2012年相关。他可能会感谢您的支持。我希望这个答案可以帮助你!

And if this does turn out to be the solution, e-mail the author of that instruction sheet and tell him to update that PDF file to be relevant for 2012. He'd probably appreciate the support. I hope this answer helps you out!

这篇关于Pygame for Python 3.2 on mac - 导入错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 09:48