tags:

views:

343

answers:

3

I'm trying to install py-appscript on the mac using 'sudo easy_install appscript'. The command runs and I get a message saying "Installed /Library/Python/..../appscript=0.20.0-py2.5-maxosx-10.5-i386.egg".

However, when I run a tool that required this (osaglue) I get an error that py-appscript isn't installed. My guess is that it's installed in some location that's not in my path, or that I need to do something more to install it.

Any ideas?

The exact text I see when running easy_install is:

Processing appscript-0.20.0-py2.5-macosx-10.5-i386.egg appscript 0.20.0 is already the active version in easy-install.pth

Installed /Library/Python/2.5/site-packages/appscript-0.20.0-py2.5-macosx-10.5-i386.egg Processing dependencies for appscript==0.20.0 Finished processing dependencies for appscript==0.20.0

and the error when trying to run osaglue is:

Sorry, py-appscript 0.18.1 or later is required to use osaglue. Please see the following page for more information:

http://appscript.sourceforge.net/py-appscript/install.html

Please install py-appscript and run this command again.

A: 

What does which python return?

Update: Ok, so go into /usr/bin and do a ls -l | grep python. Does /usr/bin/python link to the OSX installation?

If it does not, I had the same problem a while back. easy_install is installing the egg for the python package that came with OSX, but you're using a different version to execute code when you call python. I believe my solution was to reinstall setuptools and tell it to place the eggs in the location for the python distro that I wanted to use.

vgm64
/usr/bin/python
psychotik
i think that's the problemlrwxr-xr-x 1 root wheel 72 Sep 19 2008 python -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/pythoneasy_install is installing to /Library/Python.FUBAR. Cool, I'll try your workaround.
psychotik
If you don't necessarily need the /System/Library/Framework distribution, you could just change the link to go to the /Library/Framework python.
vgm64
Do not change /usr/bin/python to point to anything other than /System/Library/Frameworks/Python.framework. In general, anything in /System and in /usr/bin are installed and managed by Apple.
Ned Deily
A: 

You can found all your avaiable packages in the sys.path. Start the pythonshell and type in this code:

import sys
print sys.path
DerKlops
A: 

Do you have more than one version of Python installed on your machine? (Apple install their own copy of Python in /System, with third-party modules at /Library/Python, by default.) If so, chances are, easy_install is installing appscript for one Python, while osaglue is using another.

That said, if you're looking to generate glue code for objc-appscript, the simplest approach is to use ASDictionary (http://appscript.sourceforge.net/tools.html) to generate the glue directly; no need to mess around installing py-appscript and other dependencies.

has