Python and package installation on MAC
This guide assume root access to the computer. Otherwise, refer to this article for non-root installation from source code.
Normally, the installation is much straightforward on Linux, either apt-get or yum can help resolve the dependencies. For Windows users, here are the pre-compiled packages available http://www.lfd.uci.edu/~gohlke/pythonlibs/. The installation on MAC is not difficult, but there might be some small troubles that make you not happy.
Install xcode for developer
Download and install xcode from apple app store, then open a terminal and type
Type gcc in the terminal to check the tools are properly installed
Macports
This guide uses macports, which can be find here. Remember to select the right version for your system or it wont work. Then in the terminal, type
Install python and basic scientific librarys
Install the scipy stack
This may take a while. After the installation finished, all the packages will be located in /opt/local/
, which is the default installation path of macports. Since MAC OS shipped a python, we have to change that
This will make python
point to the right version.
Other package
To find other packages with macport, type
which gives you
For the other package not in the repository, use
This places the files in ~/Library
. This is important, otherwise the files mess up the macport tree while not notifying it.
homebrew can achieve this similarly. It does not conflict with macport so you can have them both in the system. Normally, I use macport for python exclusively and homebrew for the other software.