Snow Leopard's Python 2.6?

27 views
Skip to first unread message

Nathan

unread,
Sep 3, 2009, 1:19:28 PM9/3/09
to pyglet...@googlegroups.com
I just updated to Snow Leopard, reinstalled pyglet, and my pyglet app
now fails on "from pyglet.gl import *" :-(

Help!?

$ python
Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyglet.gl import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.5/site-packages/pyglet/gl/__init__.py", line
507, in <module>
import pyglet.window
File "/Library/Python/2.5/site-packages/pyglet/window/__init__.py",
line 1667, in <module>
from pyglet.window.carbon import CarbonPlatform, CarbonWindow
File "/Library/Python/2.5/site-packages/pyglet/window/carbon/__init__.py",
line 69, in <module>
framework='/System/Library/Frameworks/QuickTime.framework')
File "/Library/Python/2.5/site-packages/pyglet/lib.py", line 90, in
load_library
return self.load_framework(kwargs['framework'])
File "/Library/Python/2.5/site-packages/pyglet/lib.py", line 226, in
load_framework
lib = ctypes.cdll.LoadLibrary(realpath)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/__init__.py",
line 423, in LoadLibrary
return self._dlltype(name)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/__init__.py",
line 345, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/System/Library/Frameworks/QuickTime.framework/QuickTime,
6): no suitable image found. Did find:
/System/Library/Frameworks/QuickTime.framework/QuickTime: no matching
architecture in universal wrapper
/System/Library/Frameworks/QuickTime.framework/QuickTime: no matching
architecture in universal wrapper

Tristam MacDonald

unread,
Sep 3, 2009, 2:03:27 PM9/3/09
to pyglet...@googlegroups.com
On Thu, Sep 3, 2009 at 1:19 PM, Nathan <nathan...@gmail.com> wrote:

I just updated to Snow Leopard, reinstalled pyglet, and my pyglet app
now fails on "from pyglet.gl import *"  :-(

Help!?

Install pyglet manually - the binary installer is not very compatible with Snow Leopard.

Nathan

unread,
Sep 3, 2009, 2:21:01 PM9/3/09
to pyglet...@googlegroups.com
On Thu, Sep 3, 2009 at 12:03 PM, Tristam MacDonald<swift...@gmail.com> wrote:
> On Thu, Sep 3, 2009 at 1:19 PM, Nathan <nathan...@gmail.com> wrote:
>>
>> I just updated to Snow Leopard, reinstalled pyglet, and my pyglet app
>> now fails on "from pyglet.gl import *"  :-(
>>
>> Help!?
>
> Install pyglet manually - the binary installer is not very compatible with
> Snow Leopard.

I tried installing 1.1.3 from the tarball, but it didn't have any
effect (same error).

I tried checking out the pyglet trunk from the googlecode subversion
repository and installing it, but that also had no effect as far as I
can tell:

Alex Holkner

unread,
Sep 3, 2009, 6:07:48 PM9/3/09
to pyglet...@googlegroups.com
On Fri, Sep 4, 2009 at 4:21 AM, Nathan<nathan...@gmail.com> wrote:
>
> On Thu, Sep 3, 2009 at 12:03 PM, Tristam MacDonald<swift...@gmail.com> wrote:
>> On Thu, Sep 3, 2009 at 1:19 PM, Nathan <nathan...@gmail.com> wrote:
>>>
>>> I just updated to Snow Leopard, reinstalled pyglet, and my pyglet app
>>> now fails on "from pyglet.gl import *" :-(
>>>
>>> Help!?
>>
>> Install pyglet manually - the binary installer is not very compatible with
>> Snow Leopard.
>
> I tried installing 1.1.3 from the tarball, but it didn't have any
> effect (same error).
>
> I tried checking out the pyglet trunk from the googlecode subversion
> repository and installing it, but that also had no effect as far as I
> can tell:
>
> $ python
> Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
> [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from pyglet.gl import *
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/Library/Python/2.5/site-packages/pyglet/gl/__init__.py", line
> 507, in <module>

For a start, you're still loading pyglet from the Python/2.5
directory, not the local one you just downloaded. Perhaps you've got
a funny PYTHONHOME or PYTHONPATH set somewhere?

> OSError: dlopen(/System/Library/Frameworks/QuickTime.framework/QuickTime,
> 6): no suitable image found. Did find:
> /System/Library/Frameworks/QuickTime.framework/QuickTime: no matching
> architecture in universal wrapper
> /System/Library/Frameworks/QuickTime.framework/QuickTime: no matching
> architecture in universal wrapper

Here's the real problem though. Here's a session from Snow Leopard's
Python 2.6:

% /System/Library/Frameworks/Python.framework/Versions/2.6/bin/python


Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>> from ctypes import sizeof, c_voidp
>>> sizeof(c_voidp)
8

That's a 64-bit Python binary. pyglet won't work in 64-bits on OS X
(besides the QuickTime issue here, Carbon also is 32-bit only). While
waiting for someone with much free time to complete a Cocoa port of
pyglet, you can download a 32-bit Python from python.org.

Alex.

Nathan

unread,
Sep 3, 2009, 8:30:36 PM9/3/09
to pyglet...@googlegroups.com

Bingo, I don't even remember setting it, but I have:

PYTHONPATH=/Library/Python/2.5/site-packages

>> OSError: dlopen(/System/Library/Frameworks/QuickTime.framework/QuickTime,
>> 6): no suitable image found.  Did find:
>>        /System/Library/Frameworks/QuickTime.framework/QuickTime: no matching
>> architecture in universal wrapper
>>        /System/Library/Frameworks/QuickTime.framework/QuickTime: no matching
>> architecture in universal wrapper
>
> Here's the real problem though.  Here's a session from Snow Leopard's
> Python 2.6:
>
> % /System/Library/Frameworks/Python.framework/Versions/2.6/bin/python
> Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
> [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from ctypes import sizeof, c_voidp
>>>> sizeof(c_voidp)
> 8
>
> That's a 64-bit Python binary.  pyglet won't work in 64-bits on OS X
> (besides the QuickTime issue here, Carbon also is 32-bit only).  While
> waiting for someone with much free time to complete a Cocoa port of
> pyglet, you can download a 32-bit Python from python.org.
>
> Alex.

Dang. I was rather happy that pyglet worked so well with the system
python before. So if I understand correctly, unless someone does a
whole lot of work to port pyglet<->Carbon interactions to be
pyglet<->Cocoa interactions, I'm stuck with needing to manually
install a 32-bit Python and use pyglet with that. Am I understanding
that correctly?

~ Nathan

Tristam MacDonald

unread,
Sep 4, 2009, 10:51:59 AM9/4/09
to pyglet...@googlegroups.com
Pretty much.

And don't hold your breath on a Cocoa port of pyglet. I took a shot at it earlier this year, and while I have something that mostly works, it isn't anywhere close to a public release, and requires major changes to pyglet itself (because PyObjC does everything arse-backwards).

A better solution might be to introduce a C 'shim', which implements the necessary Cocoa code, and pyglet can access directly through ctypes. Unfortunately, this doesn't really fit with pyglet's philosophy (at least IMO).

Nathan

unread,
Sep 4, 2009, 12:49:59 PM9/4/09
to pyglet...@googlegroups.com

No worries, I plan to keep breathing.

I went ahead and installed the Python binary installer from
python.org, and then reinstalled pyglet, and that seems to work.
Unfortunately my little app also uses Twisted, which I haven't yet
figured out how to get installed into the new 32-bit python (sigh).
I've moved over to the twisted mailing list for help getting twisted
working. Thanks! (Oh, and if anyone has tips for how to get twisted
to get installed into the correct place, I'd love to hear them)

~ Nathan

Reply all
Reply to author
Forward
0 new messages