1

甚至可能吗?

过去 2 天里,我一直在尝试让 pygame 在 OSX Lion 上使用 Python 3,在在线阅读了免费的 Invent Your Own Computer Games With Python 书籍之后。pygame 官方网站有 Python 2 的安装包,但我宁愿不降级,因为我正在关注的书使用 Python 3。

在网上和 StackOverflow 上查找了大量教程后,我认为最接近我的是这里:http ://www.albrecht.lt/2012/06/python-3-2-with-pygame-under-mac-os -lion-10-7/

我已经顺利完成了前几步,并将 Homebrewsbrew doctor错误归结为:

Warning: /Library/Frameworks/Mono.framework detected
This can be picked up by CMake's build system and likely cause the build to
fail. You may need to move this file out of the way to compile CMake.

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

据我了解这不是一个大问题(尽管我可能完全错了......)

我最初跳过brew install python3,因为我已经有了 Python 3。我的第一个问题是当我输入brew install sdl sdl_image sdl_mixer sdl_ttf portmidi. dl-1.2.15、sdl_image-1.2.12 和 sdl_mixer-1.2.12 都安装成功,但它告诉我:

configure: error:
*** Unable to find FreeType2 library (http://www.freetype.org/)

但我认为这不是那么致命。我遇到的第一个大问题是当我进入时brew install --HEAD smpeg,它简单地告诉我:

Error: No available formula for smpeg

我试图忽略它并继续前进/usr/local/share/python3/easy_install pip,但随后我得到:

-bash: /usr/local/share/python3/easy_install: No such file or directory

这似乎是最大的问题,因为大多数进一步的说明只会告诉我同样的事情,即没有这样的文件或目录。


进一步阅读后,我按照这个问题的公认答案(如何在 Mac OS X 10.6.4 上卸载 Python 2.7?)从我的系统中删除 Python 2.7 的残余,然后尝试brew install python3完全按照说明进行操作,但我仍然遇到相同的错误。

不过,当我尝试这个时,我确实已经安装了 python 3,所以现在当我尝试“打开”一个 .py 文件时,它显示 IDLE.app 和 IDLE 3.app(尽管两者都是 3.2.2)。在我尝试之前,我是否需要完全从我的计算机中彻底清除所有 python 痕迹brew install python3?这甚至会有所帮助,还是问题出在完全不同的地方?


这是一个相当广泛的问题,我感谢任何读到这里的人。我真的不知道如何解决这个问题,而且我有点气馁,因为我在网上阅读了很多关于让 pygame 在 python 3 上工作有多么困难的咆哮和抱怨,尤其是对于 OSX Lion。非常感谢任何帮助、指导或任何形式的输入。

4

0 回答 0