In case you are a user of (free via MacPorts) PyMOL and haven’t heard the news, the upgrade to the latest Mac OS X release—Yosemite (10.10)—breaks the installation process. Which really sucks because you ideally need to reinstall the ports collection after upgrading (or fresh installing) to Yosemite. Thankfully, the port maintainer finally posted a temporary fix to get things working in the interim until the port can be properly updated. However, it may not be the most intuitive fix for everyone to employ.

To get things working, you’ll need to first patch the Makefile with the fix. Instructions on how to do this for ports in general is outlined here, but for simplicity’s sake, I’ll give readers the rundown here. We’ll omit making the backup copy (since we’re not concerned about keeping the old broken copy when we can just pull down a new one), so going straight to the Makefile patching, you’ll want to enter from the Terminal application…
sudo port edit --editor nano pymol1
From here, you’re going to want to edit the following line near the top of the file:

PortSystem          1.0
PortGroup           python 1.0
PortGroup           active_variants 1.1

name                pymol
version             1.7.1.1
revision            1
categories          science chemistry
license             GPL
maintainers         bromo.med.uc.edu:howarth
description         Molecular graphics system

…to…

PortSystem          1.0
PortGroup           python 1.0
PortGroup           active_variants 1.1

name                pymol
version             1.7.1.1
revision            2
categories          science chemistry
license             GPL
maintainers         bromo.med.uc.edu:howarth
description         Molecular graphics system

Down at the very bottom of the this file (you can scroll down more pages), you’ll find another block we need to update as follows:

post-destroot {
     file copy ${worksrcpath}/setup/pymol_macports ${destroot}${prefix}/bin/pymol
     file attributes ${destroot}${prefix}/bin/pymol -permissions a+x
     foreach d {data modules examples test scripts} {
        copy ${worksrcpath}/${d} ${destroot}${python.pkgd}/pymol
    }
}

…to…

post-destroot {
     file delete ${destroot}${prefix}/bin/pymol
     file copy ${worksrcpath}/setup/pymol_macports ${destroot}${prefix}/bin/pymol
     file attributes ${destroot}${prefix}/bin/pymol -permissions a+x
     foreach d {data modules examples test scripts} {
        copy ${worksrcpath}/${d} ${destroot}${python.pkgd}/pymol
    }
}

With both those edits in place, you can press Ctrl+X to exit the editor, remembering to enter “Y” when prompted to save the changes in the process. I saw no checksum lines in the file we were just editing, so we can just do a livecheck to update the port to accept the modified Portfile: sudo port livecheck pymol. Last, we can now install the patched port: sudo port install pymol.

I ran into a weird error near the end saying something about the file already being in place, so I also had to throw in one more command to finish the install: sudo port -f activate pymol. So in case you run into the same issue, there is that minor fix as well.

Tangential to the patch but important for the installation, MacPorts does a (apparently?) shitty job of enforcing the port requirements when installing pymol dependencies (namely for special variants of tcl & tk). To save yourself some trouble in that regard, you can pre-install the appropriate versions as follows:
sudo port install tcl -corefoundation && sudo port install tk -quartz

Happy modeling folks!


1Unless you really prefer vi as a text editor compared to the much more intuitive (IMHO) nano. If you’re familiarized with vi however, I would hazard you probably don’t need this tutorial.

Leave a Reply

Your email address will not be published. Required fields are marked *