Hi,

I'm trying to use appscript on my MacBook Pro running OS X 10.5.7 and
the stock Apple Python.  It's never had appscript installed before.
However, I can't get the binary ASDictionary I downloaded to run:

  Traceback (most recent call last):
    File 
"/Developer/Applications/appscript/ASDictionary.app/Contents/Resources/__boot__.py",
 line 31, in <module>
      _run('ASDictionary.py')
    File 
"/Developer/Applications/appscript/ASDictionary.app/Contents/Resources/__boot__.py",
 line 28, in _run
      execfile(path, globals(), globals())
    File 
"/Developer/Applications/appscript/ASDictionary.app/Contents/Resources/ASDictionary.py",
 line 17, in <module>
      import osax, appscript, mactypes
    File "build/bdist.macosx-10.3-i386/egg/osax.py", line 38, in <module>
    File "build/bdist.macosx-10.3-i386/egg/aem/aemsend.py", line 82, in send
  aem.aemsend.EventError: Command failed: Application could not handle this 
command. (-1708)
  2009-05-31 15:42:43.946 ASDictionary[4551:10b] ASDictionary Error
  2009-05-31 15:42:43.948 ASDictionary[4551:10b] ASDictionary Error
  An unexpected error has occurred during execution of the main script
  
  EventError: Command failed: Application could not handle this command. (-1708)

So I tried building newer versions of everything, which helped in the
past.  I did run into a problem with modulegraph and newer versions of
setuptools but that was easily fixed.

Now I seem to be having issues with py2app.  First, if I try to use
the bundled PyObjC, py2app doesn't pick it up, so I get an error
trying to import 'objc'.

Next, I tried installing the current PyObjC, but now I get a truly
weird error running the built ASDictionary:

  Traceback (most recent call last):
    File 
"/Users/nicholas/src/ASDictionary/src/dist/ASDictionary.app/Contents/Resources/__boot__.py",
 line 31, in <module>
      _run('ASDictionary.py')
    File 
"/Users/nicholas/src/ASDictionary/src/dist/ASDictionary.app/Contents/Resources/__boot__.py",
 line 28, in _run
      execfile(path, globals(), globals())
    File 
"/Users/nicholas/src/ASDictionary/src/dist/ASDictionary.app/Contents/Resources/ASDictionary.py",
 line 11, in <module>
      import objc
    File "objc/__init__.pyc", line 22, in <module>
    File "objc/__init__.pyc", line 19, in _update
    File "objc/_objc.pyc", line 18, in <module>
    File "objc/_objc.pyc", line 15, in __load
  ImportError: 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/objc/_objc.so'
 not found
  2009-05-31 15:47:49.610 ASDictionary[4560:10b] ASDictionary Error
  2009-05-31 15:47:49.612 ASDictionary[4560:10b] ASDictionary Error
  An unexpected error has occurred during execution of the main script
  
  ImportError: 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/objc/_objc.so'
 not found
  
Why is it trying to look for _objc.so *there*?  It's actually in
/Library/Python/2.5/site-packages/pyobjc_core-2.2b2-py2.5-macosx-10.5-i386.egg/objc/_objc.so.

If I build ASDictionary with py2app -A, I'm back to the old error
about not being able to import objc:

  Traceback (most recent call last):
    File 
"/Users/nicholas/src/ASDictionary/src/dist/ASDictionary.app/Contents/Resources/__boot__.py",
 line 58, in <module>
      
_run(('\x00\x00\x00\x00\x01(\x00\x02\x00\x00\x04Babs\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc1V\xc6\x82H+\x00\x00\x01-\xf1\xbf\x0fASDictionary.py\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01-\xf2\x03\xc6HIk\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00I
 
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x08\x00\x00\xc1W\x0c\xd2\x00\x00\x00\x11\x00\x08\x00\x00\xc6H\x8f\xbb\x00\x00\x00\x0e\x00
 
\x00\x0f\x00A\x00S\x00D\x00i\x00c\x00t\x00i\x00o\x00n\x00a\x00r\x00y\x00.\x00p\x00y\x00\x0f\x00\n\x00\x04\x00B\x00a\x00b\x00s\x00\x12\x003Users/nicholas/src/ASDictionary/src/ASDictionary.py\x00\x00\x13\x00\x01/\x00\x00\x15\x00\x02\x00\x0f\xff\xff\x00\x00',
 '/Users/nicholas/src/ASDictionary/src/ASDictionary.py'))
    File 
"/Users/nicholas/src/ASDictionary/src/dist/ASDictionary.app/Contents/Resources/__boot__.py",
 line 54, in _run
      execfile(path, globals(), globals())
    File "/Users/nicholas/src/ASDictionary/src/ASDictionary.py", line 11, in 
<module>
      import objc
  ImportError: No module named objc
  2009-05-31 15:49:24.391 ASDictionary[4605:10b] ASDictionary Error
  2009-05-31 15:49:24.394 ASDictionary[4605:10b] ASDictionary Error
  An unexpected error has occurred during execution of the main script
  
  ImportError: No module named objc

despite the fact that there is not one but *two* copies of PyObjC
installed.  (Everything works fine if I just 'import objc' from a
script, of course.)

Help?  I just wanted to write a quick script to tag some PDFs and I'm
now over two hours into this... it's almost driving me to AppleScript!

Thanks,

-- 
Nicholas Riley <njri...@uiuc.edu>
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to