Upgrading to Mountain Lion

I just upgraded to Mountain Lion and here are some of my notes related to scientific Python installs.

If you’ve already got a working installation it will likely continue to work after upgrading. Regardless of whether you plan to keep using an existing install or make a new one you’ll probably want to do the following two things:


You’ll need a Mountain Lion compatible set of command line tools and development libraries so reinstall Xcode or the Command Line Tools for Xcode. I personally prefer the later now that I use Sublime Text 2 for code editing. If you install Xcode make sure to install the command line tools from the preferences.


ML doesn’t come with X11 installed so install XQuartz from http://xquartz.macosforge.org/ if you anticipate needing X11.

Python Libraries

  • NumPy compiles without issue.
  • SciPy is waiting on a small change before it will compile on Mountain Lion. I expect that to go in soon and they may release SciPy 0.10.2 to make it Mountain Lion compatible. Even if they don’t you’ll be able to install from the GitHub repository once the change is made.
  • matplotlib must be installed from the GitHub repository at this time.
Upgrading to Mountain Lion

6 thoughts on “Upgrading to Mountain Lion

  1. I have upgraded to Mountain Lion and python did not work directly. Reinstalling fresh python also did not help. What I did to make it work was simple. I just copied the entire /Library/Python/2.7 folder from the time machine backup (which worked for Lion) and now it works as before.

    1. It’s possible that is a system location that gets overwritten. All of my installation is in /usr/local or my home folder and it was untouched by the upgrade.

  2. Found your post after a bit of Googling …

    You mentioned that NumPy compiled for you without any issues. Unfortunately, that is not the case with me. Here’s the error I am getting:

    clang: error: invalid argument ‘-faltivec’ only allowed with ‘ppc/ppc64’

    error: Command “clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DNO_ATLAS_INFO=3 -Inumpy/core/blasdot -Inumpy/core/include -Ibuild/src.macosx-10.8-intel-2.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -Ibuild/src.macosx-10.8-intel-2.7/numpy/core/src/multiarray -Ibuild/src.macosx-10.8-intel-2.7/numpy/core/src/umath -c numpy/core/blasdot/_dotblas.c -o build/temp.macosx-10.8-intel-2.7/numpy/core/blasdot/_dotblas.o -faltivec -I/System/Library/Frameworks/vecLib.framework/Headers” failed with exit status 1

    Any ideas about this? I am using ‘pip’ to instal numpy-1.6.1. Did you compile the latest?

    1. I just did pip install numpy and there was no problem. I believe that installs numpy 1.6.2. Best thing to do is probably to try to install the latest numpy and see if it works. That’ll let you know whether the problem is numpy or something about your system.

  3. Azalee says:

    Hi Matt,

    I just got everything installed on Mountain Lion. I was starting from scratch with nothing initially installed.

    I used pip install numpy and it installed without issue. However, when I tried to pip install scipy (I also tried to install it using the git repository with similar results) I got an error message that it couldn’t find npymath.ini in numpy (the full error message is documented here:http://stackoverflow.com/questions/12574604/scipy-install-on-mountain-lion-failing). Based on this I tried various methods of downloading numpy. I tried installing the dmg from sourceforge but it said that I didn’t have Python 2.6. I also tried retrieving it from github using both the pip install url (which failed in the same pip way) and by downloading the repository and running python setup.py build and python setup.py install. When I did the setup.py method I got an error message when I tried to import numpy that said that I couldn’t import numpy from the source folder even when I wasn’t in the source folder.

    I was finally able to get numpy and scipy installed by downloading a scipy superpack as detailed here: http://sergeykarayev.com/work/2012-08-08/setting-up-mountain-lion/ . This downloads numpy 1.8 and scipy 0.12 both dev versions (previously I had been working with numpy 1.6.2 and scipy 0.11).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s