python 在 leopard 上安装

发布于 2024-07-11 03:40:00 字数 1297 浏览 12 评论 0原文

我承认我完全被 python 安装搞糊涂了。 有人可以帮助我如何安装

我想玩 PyGame、PyOpenGL 等的模块。所以我安装了它们,但每次我输入“import pygame”时都会显示错误消息。

到目前为止,这是我的环境。

在 .bash_profile 中,

PATH=${PATH}:/System/Library/Frameworks/Python.framework/Versions/Current/bin

使用 easy_install PyOpenGL 放置了此

/Library/Python/2.5/site-packages/PyOpenGL-3.0.0b8-py2.5.egg

Locating pygame 模块

dchong:~ danielchong$ locate pygame
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/recipes/pygame.py
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/recipes/pygame.pyc

dchong:~ danielchong$ locate pyopengl
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/recipes/pyopengl.py
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/recipes/pyopengl.pyc

当我运行 python 时,

Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pygame

I'll admit I'm completely dumbed by python install. Can someone help me on how to install module

I want to play with PyGame, PyOpenGL etc. So I install them, but I everytime I type "import pygame" error message shows up.

here's my environment so far.

In .bash_profile

PATH=${PATH}:/System/Library/Frameworks/Python.framework/Versions/Current/bin

Using easy_install PyOpenGL placed this

/Library/Python/2.5/site-packages/PyOpenGL-3.0.0b8-py2.5.egg

Locating pygame module

dchong:~ danielchong$ locate pygame
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/recipes/pygame.py
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/recipes/pygame.pyc

dchong:~ danielchong$ locate pyopengl
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/recipes/pyopengl.py
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/py2app/recipes/pyopengl.pyc

when I run python

Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pygame

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

几度春秋 2024-07-18 03:40:00

首先,我并不是 OS X 上默认安装的 python 的忠实粉丝,主要是因为它通常是一个相当旧的版本。 我发现如果我使用 macports 包,一切都会更好。

easy_install 似乎与 macports 包一起使用效果更好,但也许这只是因为我懒得弄清楚默认安装的所有细微差别。

从我所看到的来看,包的路径似乎设置不正确。 您确定您使用的是正确的 site-packages 目录吗?

I'm not a huge fan of the default python install on OS X in the first place, mostly because it's usually a pretty old version. I find everything works better if I use the macports package.

easy_install seems to work better with the macports package, but maybe that's just because I'm too lazy to figure out all the nuances of the default install.

From what I can see there, it looks like the path to the packages isn't set correctly. Are you sure you're using the right site-packages directory?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文