views:

1619

answers:

5

I just tried (for the first time, I might add) a

port upgrade installed

in Macports, and I'm afraid I might come to regret it: A lot of errors -- specially regarding X11 and Python.

Here's a typical error message regarding python:

---> Activating python24 2.4.5_4+darwin_9 Error: Activating python24 2.4.5_4 failed: Image error: /opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4 already exists and does not belong to a registered port. Unable to activate port python24.

My question: Should I expect a bit of trouble? And: Any hints on fixing these errors?

I did do "sync" and "selfupdate" before upgrading.

+5  A: 

Usually, when my macports installation starts going nutty (usually because I goofed it up), I delete the /opt folder and reinstall. I'm just lazy, i guess. From what it looks like though, you are trying to reinstall a new port over an old/existing folder.

Have you tried Porticus? It will do a good job of telling you which ports are installed and active. Perhaps if you deactivated a current python port, and installing the new one, that can get you moving again.

casademora
I hope to get away with not reinstalling -- there's a lot of stuff there. On the other hand, a cleanup might be good. Haven't seen Porticus, will take a look, thanks.
rebra
thanks a lot. I had a problem with zlib (Error: port activate failed: Image error: /opt/local/include/zconf.h already exists and does not belong to a registered port. Unable to activate port zlib.) -- Deleting the /opt folder and reinstalling Macports worked perfectly. Thanks a lot!!
Brock Woolf
im pretty sure my problems started from doing silly things with multiple times of reinstalling Macports over itself.
Brock Woolf
+1  A: 

Mac OS X 10.4.11 ships with Python 2.4 (not sure about Leopard). Its path is /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4, so you might not need to install at all.

Simon
Yes, I know. Some dependencies in Macports are responsible for that one. :-)
rebra
+4  A: 

If, as the error message indicates, that file exists in the /opt directory and does not belong to a registered port, you'd have to wonder how it got there. Maybe left over from a previous, possibly botched, installation?

Either way, I don't see the harm in just deleting the file in question (and, from the looks of it, probably the entire /opt/local/Library/Frameworks/Python.framework/Versions/2.4 directory)

Generally speaking, to resolve problems like this you should contact the port maintainer, or ask on the macports mailing list.

Alastair
+1  A: 

cleaning /opt/local and reinstalling macports worked fine for me on snow leopard.

ashkanr
+1  A: 

I also recently got "... already exists and does not belong to a registered port", in my case because I was trying to use Macports to install Putty (to support FireFTP). Anyway, for the past year I've been using 'fink' and *apt-ge*t on my Leopard, mostly because I'm more familiar with Debian/Ubuntu normally. Soo, enough background.

The thing is, I had a library (expat) installed through apt-get that macports wanted to upgrade. But it was registered using a totally different, competing package manager. THAT is what this message meant to me. Makes sense. Upgrading via apt-get didn't get me to a high enough version, so we instead use FORCE to make the upgrade go through.

For me, sudo port -d -f install expat pushed the upgrade through, over-wrote the apt version, and allowed me to progress.

Here's hoping it hasn't damaged other things in the Debian checkouts in doing so.

dman