MacOS – re-install MacPorts but leave the Python installation, done via MacPorts, alone

macosmacportspython

Okay, I admit it, I didn't really think it through when I clicked on the button to upgrade to Sierra. Having done that, I've of course made MacPorts lose its mind. I mostly don't notice because once I install Python and PIP, I don't do much with MacPorts — except to install things like LaTeX or wget.

Can I re-install MacPorts without messing up my Python installation? I have a lot of packages installed — numpy, scipy, nltk, sklearn, etc. — that I would just as soon leave alone. Everything is working well.

Best Answer

Export your list of installed packages with Macports. Uninstall your existing copy of Macports (Google search will turn up the two step process). Then upgrade to the new OS. Simply install the new Macports for your new macOS and finally install the packages from the "list" you kept.

Save your list of installed ports:

port -qv installed > myports.txt

Restore your ports following a few steps found here: https://trac.macports.org/wiki/Migration

Do NOT upgrade your macOS before exporting or first removing your Macports. Or you may be forced to manually clean things and start over or perform a tedious migration if Macports will work.

When I upgraded to macOS Sierra - my installed version of Macports would no longer run.

Best of luck!