In article <aanlkti=uzk73=srvau9bf-na9q+n1lzeqf7-ygzqj...@mail.gmail.com>, Fur Yao <i...@yaofur.com> wrote: > In my app , I want to use "appscript" . > > I use easy_install appscript , and it works well in my python script. > > But when I build a Mac app in xcode , an error appears. > > >>> > from appscript import app , k > ImportError: No module named appscript > >>> > > Then I copy the appscript folder direct from > "/Library/Python/2.6/site-packages/appscript-0.21.1-py2.6-macosx-10.6-universa > l/" > to > the app's Resources folder. > and I also copy aem mactypes.py osax.py > > And it appears: > > "ImportError: Bad magic number in > /Users/Kebot/git/Giraffa/build/Debug/Giraffa.app/Contents/Resources/appscript/ > __init__.pyc"
Your Xcode project is apparently using a different version of Python than the one appscript was installed with. If you are on OS X 10.6, you may have the Xcode target set for 10.5 instead of 10.6 and, thus, are using the Apple-supplied python2.5 in your project. For example: $ /usr/bin/python2.6 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ma cpath.pyc $ /usr/bin/python2.5 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ma cpath.pyc RuntimeError: Bad magic number in .pyc file If you do need to support 10.5, try installing appscript with python2.5, too. $ /usr/bin/easy_install-2.5 appscript -- Ned Deily, n...@acm.org _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG