13

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.

rebra
  • 1,082
  • 2
  • 7
  • 16
  • I have been installing packages to the python distribution earlier with the typical "setup.py install", but I can't see why this should give that error message. – rebra Dec 02 '08 at 20:24

6 Answers6

15

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.

Hank Gay
  • 70,339
  • 36
  • 160
  • 222
casademora
  • 67,775
  • 17
  • 69
  • 78
  • 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 Dec 02 '08 at 20:57
  • 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 May 04 '09 at 11:27
  • im pretty sure my problems started from doing silly things with multiple times of reinstalling Macports over itself. – Brock Woolf May 04 '09 at 11:28
  • Good call on Porticus. Whenever I have problems that aren't worth my time to fix, I screenshot porticus' "installed" window and wipe out /opt. Always good to have a record of everything you had, just in case something isn't working for you later. – taynaron Apr 27 '11 at 20:55
  • 2
    Don't do a screenshot when you can get a text list. `port list installed`. You can direct the output to a file and use that to automate re-installing your packages. – ocodo Oct 17 '11 at 01:01
  • 1
    Yeah, a text list is likely better. Also, Porticus seems to be dead. [Pallet](https://trac.macports.org/wiki/MacPortsGUI) (sudo port install pallet) seems the new way to go. – taynaron Dec 17 '11 at 04:06
  • 1
    I would use `port installed requested` to get a list of the ports you actually want installed. If dependencies have changed there's no need to reinstall ports that used to be dependencies but aren't anymore. – ShadSterling Jun 29 '15 at 21:56
10

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
  • 4,475
  • 1
  • 26
  • 23
  • 1
    far better than deleting the entire /opt folder. I just delete /opt/local/bin/uuid when it told me that this file didn't belong to a registered port. – Baptiste Pernet Nov 21 '11 at 21:53
7

I also recently got this error message

[...] 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-get on Leopard, because I'm more familiar with Debian/Ubuntu. So, 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.

ocodo
  • 29,401
  • 18
  • 105
  • 117
dman
  • 1,089
  • 13
  • 9
  • 1
    Yes, the `-f` option forces it to activate even with this error (should be ok since MacPorts presumably put the files there anyway, at least in my case). So just running the command again with `-f` solves this issue. – Demis Mar 18 '18 at 06:01
1

I had broken registry problem. I simply tried "sudo port -d -f uninstall program". Program referes to the program having broken registry.

  • 1
    Mac OS X doesn't have a registry -- at least not in the way that Windows does. What do you mean by that? – jvriesem Nov 15 '16 at 20:22
1

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

ashkrosh
  • 839
  • 2
  • 9
  • 11
0

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
  • 12,018
  • 4
  • 34
  • 39