Python 2.4, libxslt and MacPorts snafu
I struggled for quite a long time to get the MacPorts libxslt module for python 2.4 (required for a legacy project) to install. A lot of searching turned up many leads but no bug report, and this is a low-priority situation for port maintainers because python 2.4 is now very out of date. This is what I did.
Installed python24.
Installed py-libxslt.
At the end of the port install process for py-libxslt I received an error message. A read of the log said:
[...]
:debug:activate activate phase started at Tue Jul 6 11:48:03 BST 2010
:debug:activate Executing org.macports.activate (py-libxslt)
:error:activate Target org.macports.activate returned: Registry error: py-libxslt 2.6.21_0 not registered as installed.
:debug:activate Backtrace: Registry error: py-libxslt 2.6.21_0 not registered as installed.
while executing
"registry::installed $name $v"
(procedure "_check_registry" line 38)
invoked from within
"_check_registry $name $v"
(procedure "portimage::activate" line 58)
invoked from within
"registry_activate $name "${version}_${revision}${portvariants}" [array get user_options]"
(procedure "portactivate::activate_main" line 6)
invoked from within
"$procedure $targetname"
:info:activate Warning: the following items did not execute (for py-libxslt): org.macports.activate
:notice:activate Log for py-libxslt is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-libxslt/main.logThis indicated that everything was happily built, but the software was not installed in its correct directory for some reason (not evident in the log). I found it difficult to get my head around the way MacPorts works in the time available and establish what went wrong. So I short-circuited the problem by copying the software (libxslt.py) from the MacPorts build directory into the lib directory where it should have been put (/opt/local/lib/python2.4/site-packages).
This will mess up MacPorts’ information about what is installed, so other python 2.4 dependent things might conceivably not be installable. Equally it might be tricky to remove the /opt/local/lib/python2.4/site-packages directory using MacPorts commands without forcing it. But meanwhile I have a working python libxslt module and that’s what I needed.