To install Mac Ports:

Install command line [type]: sudo xcode-select --install

Agree to xcode license [type]: sudo xcodebuild -license

Install latest dmg package from

Install latest XQuartz package from

set in .bashrc: export PATH=/opt/local/bin:/opt/local/sbin:$PATH

The rest of the commands should be typed on a command line prompt:

Installing the ports:

sudo port install python27

sudo port select --set python python27

sudo port install texlive +full

sudo port install py27-pandas py27-ephem py27-ipython py27-scientific py27-scimath py27-scipy py27-scitools git py27-ipy emacs-app jabref R-app wget kdiff3 dia git-extras aspell aspell-dict-en py27-ipython py27-matplotlib py27-numpy py-netcdf4 ImageMagick py27-scikit-learn fdupes py-pip py-scipy py-requests mercurial netcdf-cxx netcdf-fortran py-sympy py-statsmodels gdb py27-seaborn py-pygrib pandoc py-h5py julia

sudo port install djview LaTeXiT valgrind py-sphinx sphinx


sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
sudo port load sphinx

sudo port install py27-pyfits py27-pywcs py27-atpy py27-aplpy py-serial py27-wxpython-2.8

sudo port install ffmpeg +nonfree
sudo port install gimp VLC py-exif py-hachoir-metadata

sudo port install processing


sudo port select --set ipython ipython27 
sudo port select --set pip pip27
sudo port select --set cython cython27
sudo port select --set sphinx py27-sphinx
sudo port select --set py-sympy py27-sympy

#this is not working yet on new OSXs: sudo port install GitX


To set up octave with atlas # warning it takes a long time to compile/optimize atlas
sudo port install octave

To set up WebSVN, copy
/opt/local/www/websvn/include/distconfig.php to
/opt/local/www/websvn/include/config.php and then make changes.

cp /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc ~/.matplotlib/ 

Edit .matplotlib/matplotlibrc and change the following line backend : Agg to backend : MacOSX  

The default backend is the interactive Mac OS X backend. Different backends can be specified using the ~/.matplotlib/matplotlibrc file. More details regarding backends can be found in the matplotlib FAQ:

Repeat every week or so to update:
sudo port selfupdate
sudo port install outdated

Other stuff:

#git prompt; see ~balay/bin - on MCS machines
. /usr/share/doc/git/contrib/completion/
. /usr/share/doc/git/contrib/completion/git-completion.bash
export GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWUPSTREAM="auto" export PS1='\[\e[32m\]\u@\h \[\e[36m\]${PWD}\[\e[1m\]\[\e[35m\]$(__git_ps1 " (%s)")\[\e[0m\]\n\$ '

The 'SHOWUPSTREAM' puts a '<' or '=' or '>' arrow next to the branch name to show if the branch has new commits on 'remote/branchname' or not. 

Use the following script to fix privacy issues: py+script.

To uninstall run:

sudo port -fp uninstall installed
sudo rm -rf \
/opt/local \
/Applications/DarwinPorts \
/Applications/MacPorts \
/Library/LaunchDaemons/org.macports.* \
/Library/Receipts/DarwinPorts*.pkg \
/Library/Receipts/MacPorts*.pkg \
/Library/StartupItems/DarwinPortsStartup \
/Library/Tcl/darwinports1.0 \
/Library/Tcl/macports1.0 \