On Saturday, June 9, 2012 6:53:40 PM UTC+1, Andreas Schiefer wrote:
>
> On Sat, Jun 9, 2012 at 7:12 PM, Jonathan Hartley <[email protected]> 
> wrote: 
> > One step forward: 
> > 
> > Using the same alias 'python' to run in 32 bit mode: 
> > 
> > $ python 
> > Python 3.2.2 (v3.2.2:137e45f15c0b, Sep  3 2011, 17:28:58) 
> > [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin 
> > Type "help", "copyright", "credits" or "license" for more information. 
> >>>> import pyglet 
> >>>> pyglet.options['darwin_cocoa'] = True 
> > 
> >>>> import pyglet.window 
> > Traceback (most recent call last): 
> [...] 
> > ImportError: No module named Foundation 
>
> I think you are missing PyObjC, but I've no experience with that. 
> Maybe you can try: http://code.google.com/r/evilphillip-cocoa-ctypes2/ 
> As I understand it, this uses ctypes for interfacing with cocoa, not 
> requiring PyObjC. 
> And it seems, this will be soon the default implementation in pyglet, 
> according to this thread: 
> https://groups.google.com/d/msg/pyglet-users/fRYR_FUsrMQ/Y1T1MEKEOSoJ 
>


Thanks for the ideas.

I wasn't yet able to get evilphilip-cocoa-ctypes2 to work under Python3.2:


$ arch -i386 python 
Python 3.2.2 (v3.2.2:137e45f15c0b, Sep  3 2011, 17:28:58) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyglet
>>> pyglet.options['darwin_cocoa'] = True
>>> import pyglet.window
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File 
"/Users/jhartley/.envs/adventure/lib/python3.2/site-packages/pyglet/window/__init__.py",
 
line 133, in <module>
    from pyglet.gl import gl_info
  File 
"/Users/jhartley/.envs/adventure/lib/python3.2/site-packages/pyglet/gl/__init__.py",
 
line 220, in <module>
    from .cocoa import CocoaConfig as Config
  File 
"/Users/jhartley/.envs/adventure/lib/python3.2/site-packages/pyglet/gl/cocoa.py",
 
line 15, in <module>
    from pyglet.canvas.cocoa import CocoaCanvas
  File 
"/Users/jhartley/.envs/adventure/lib/python3.2/site-packages/pyglet/canvas/__init__.py",
 
line 90, in <module>
    from pyglet.canvas.cocoa import CocoaDisplay as Display
  File 
"/Users/jhartley/.envs/adventure/lib/python3.2/site-packages/pyglet/canvas/cocoa.py",
 
line 15, in <module>
    from pyglet.libs.darwin.cocoapy import *
  File 
"/Users/jhartley/.envs/adventure/lib/python3.2/site-packages/pyglet/libs/darwin/__init__.py",
 
line 6, in <module>
    from .cocoapy import *
  File 
"/Users/jhartley/.envs/adventure/lib/python3.2/site-packages/pyglet/libs/darwin/cocoapy/__init__.py",
 
line 32, in <module>
    from .runtime import objc, send_message, send_super
  File 
"/Users/jhartley/.envs/adventure/lib/python3.2/site-packages/pyglet/libs/darwin/cocoapy/runtime.py",
 
line 1100, in <module>
    class DeallocationObserver_Implementation(object):
  File 
"/Users/jhartley/.envs/adventure/lib/python3.2/site-packages/pyglet/libs/darwin/cocoapy/runtime.py",
 
line 1101, in DeallocationObserver_Implementation
    DeallocationObserver = ObjCSubclass('NSObject', 'DeallocationObserver', 
register=False)
  File 
"/Users/jhartley/.envs/adventure/lib/python3.2/site-packages/pyglet/libs/darwin/cocoapy/runtime.py",
 
line 1007, in __init__
    self.objc_cls = create_subclass(superclass, name)
  File 
"/Users/jhartley/.envs/adventure/lib/python3.2/site-packages/pyglet/libs/darwin/cocoapy/runtime.py",
 
line 562, in create_subclass
    superclass = get_class(superclass)
  File 
"/Users/jhartley/.envs/adventure/lib/python3.2/site-packages/pyglet/libs/darwin/cocoapy/runtime.py",
 
line 402, in get_class
    return c_void_p(objc.objc_getClass(name))
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type



As an alternative approach, I tried to install pyobjc from PyPI, but wasn't 
able to, not with pip (which is documented to not work), nor with easy 
install, even specifying older versions, nor downloading the source and 
running 'setup.py install', nor from the source in Hg. :-(

 
It's late though, I'm probably doing something dumb. Later, all.

  Jonathan

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pyglet-users/-/4oLO8qLbZqUJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to