3

I'm trying to run some of the Quartz demos in /Developer/Examples/Quartz/Python with Mac 10.5.8 and Python 2.6. However, I'm getting errors that CoreGraphics isn't found.

Traceback (most recent call last):
  File "circle.py", line 38, in <module>
    from CoreGraphics import *
ImportError: No module named CoreGraphics

In looking at Apple's documentation, isn't this supposed to be baked in? http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_python/dq_python.html#//apple_ref/doc/uid/TP30001066-CH218-TPXREF101

1 Answer 1

4

The CoreGraphics wrapper is supplied by Apple as part of the Apple-supplied Python in OS X. Since in OS X 10.5 there is no Apple-supplied version of Python 2.6 (Apple supplies 2.5 and 2.3 there), you must be using a non-Apple version, possibly from a python.org installer or MacPorts. They will not have this module. Either switch to using the Apple-supplied 2.5 or take a look at using the open-source PyObjC Quartz bindings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.