views:

230

answers:

2

I accidentally installed pyobjc 2.2 with easy-install pyobjc, and it's causing problems: When I try to import it I get the error

Incompatible library version: _objc.so requires version 10.0.0 or later, but libxml2.2.dylib provides version 9.0.0

I'm not interested in fixing that though, all I want is my pyobjc 2.0 back. I've tried removing pyobjc 2.2 and reinstalling python, and I've tried building 2.0 from the svn trunk (I get the error lipo: can't figure out the architecture of [random filename].out)

I imagine there must be a good way of doing this but it escapes me. Any insight would be appreciated.

Edit: Python 2.6 and OSX 10.5

A: 

If you are using the Apple-supplied Python 2.5 on 10.5 Leopard, which comes with PyObjC 2.0 built-in, probably the easiest way to downgrade is to remove the 2.2 version from its site-packages directory, /Library/Python/2.5/site-packages. First, though, run the command:

easy_install -m pyobjc==2.2

which will edit the easy-install.pth file in that directory or you can edit the file yourself to remove the line for PyObjC 2.2. That should then revert back to the Apple-supplied version which is installed elsewhere.

If you are using another version of Python and installed PyObjC yourself, you still may be able to use easy_install to revert to it since, normally, easy_install does not remove previous versions when you upgrade. Try:

easy_install pyobjc==2.0

If that doesn't work, you may have to go to the PyObjC subversion repository and download a copy of the 2.0 branch and re-install from there:

svn co http://svn.red-bean.com/pyobjc/branches/pyobjc-20x-branch/
Ned Deily
When I remove version 2.2 from site-packages (even with removing it from easy-install.pth), Python can't find the package. "easy_install pyobjc==2.0" can't find the version.I can't compile the svn source for some reason (lipo: can't figure out the architecture of [random filename].out) I tried re-installing xcode too, no help :(
maxdj
What OS X version are you using and which Python are you using?
Ned Deily
A: 

I figured it out. The 2.5 pyobjc library is in /System/Library/Frameworks/Python.framework/Versions/2.5/...
and the command to install pyobjc for python 2.6 is

sudo port install py26-pyobjc2

Thanks anyways for the help!

maxdj