Version 26 (modified by toby, 5 years ago) (diff)


Installing GSAS-II on Mac OS X

GSAS-II has been tested by us on Intel (i386) Macs typically running 10.12. Newer versions of OS X should not be a problem. Versions of OS X as old as 10.6 should work, but you will need to find and install older Python distributions -- see section III below.

I. Installing the easy way

Most people will install GSAS-II by downloading a single file that contains all needed Python packages and then launches a script that downloads the appropriate files from the GSAS-II svn server. Use the instructions here? and please report any problems.

II. Installing for Anaconda Enthusiasts

If you are already a user of Anaconda Python, then you may not want to install yet another version of Python on your computer. If so, you can use the conda package manager in Anaconda to install GSAS-II for you with a simple terminal window command:

conda install gsas2pkg -c briantoby

See here for more information on this.

III. Installing Python etc. Manually

Note that Before GSAS-II can be used on your computer, you must have Python 2.7.x or Python 3.6+ installed with a number of required Python packages (see below.) You will also need to have subversion (svn) installed.

Getting GSAS-II to run on Macs running 10.4 or with a PPC (G4/G5) processor is likely possible, but will require considerable work since you would need to build Python and its packages from source code and compile the GSAS-II Fortran code; this is not recommended except to the cognoscenti.

Overview for Manual Installation

Please don't do this unless you have to. The single-step installer? is so much easier than the instructions below.

  1. Python: We recommend use of Anaconda Python, but we previously made extensive use of the older 32-bit EPDfree Python distribution, which can be the downloaded here -- note this requires administrator privileges to install. Another good choice is Canopy from Enthought downloads
  1. Install Subversion: (For 10.7 or earlier, skip this step; if using anaconda, you can also use the "conda install svn" command as an alterative to this step.) For Mountain Lion (OS X 10.8+) or later type svn into a terminal window (as shown here) to get a prompt from OS X to download and install this directly from Apple.
  1. Download file file from ​ and move it to the location where you want GSAS-II to be installed.
  1. Start a terminal window and run the previous file by typing <path1>python <path2>, where <path1> is the location where the full python has been loaded. If you are not sure, you can type python on a line by itself and see if you are running the python you installed. <path2>` will be where you have installed the file. Simply clicking on that file might work.
  1. Run GSAS-II with the file created by the bootstrap procedure.

Detailed Information on Installation


Python is a computer scripting language, which means that one must have the Python interpreter installed on your Mac to run a Python program. Note that Python 2.7 and Python 3.6 (and later) are both supported for GSAS-II. Macs do come with Python installed, but not with all the Python packages required by GSAS-II and adding those packages to the Mac installation is hard, if not impossible. Use of the Fink or DarwinPorts versions of Python is also not a good choice -- the GUI and graphics will be shown in X-windows rather than in Mac style.

  • We mostly use Anaconda Inc.'s Miniconda/Anaconda packages (see here for Anaconda Python). With Anaconda, you will need to use the conda command to download wxpython and possibly other packages.
  • For Macs running really old versions of OS X, you will need a compatible Python distribution. There may be older versions of Anaconda or Canopy that will work. One option that should work is the quite old EPDfree 32-bit Mac installer, provides everything one needs to run GSAS-II, except the interface needed for OpenGL graphics (PyOpenGL) which is distributed with GSAS-II; GSAS-II will attempt to install this package for you when first started. Installation of EPD free from the .dmg is easy: click on the file to open it (that might happen automatically when you download it). In that new volume, you will see the EPD_free.mpkg installer. Click on that to start the installation process. It works best to run this from the account where you will run GSAS-II and supply the name of the admin account and its password when requested, as this will cause your login shell setup file to be updated so that directory /Library/Frameworks/Python.framework/Versions/Current/bin is in your path. (This is done by adding lines like this to file ~/.profile:
    # Setting PATH for EPD-7.2-2
    export PATH

Note on OS X 10.9 (and perhaps with prior versions), when first starting GSAS-II under EPD free, one will get a warning "to open fc-list, you need to install X11..." you can ignore that warning and press Cancel. (This warning occurred twice for me.) It then seems to go away.

  • ActiveState ActivePython is a another possible alternative. This is also commercial licensed software, with a free version with no support. We have not tried this yet. If it works for you, please let us know.


If you are running 10.7 (Lion) or earlier, skip this step. For 10.8 (Mountain Lion) you must install the subversion (svn) package. To do this, type svn in a terminal window.

Alternately, install one of the following: Apple's Command Line Tools, or Apple's Xcode development environment, a 3rd party SVN package, or build from source code, see The Command Line Tools and Xcode can be downloaded from the Apple Developer's web site ( or can possibly be found on the OS X install DVD. A free 3rd party version of Subversion from WANdisco is here:

GSAS-II Installation

We prefer that GSAS-II be installed using subversion so that it is easy to get updates (which are frequent). Fortunately, with OS X 10.5, 10.6 or 10.7, Macs come with subversion installed. (10.8 see above.) This procedure loads GSAS-II using subversion:

  1. Create a folder where you want to install GSAS-II.
  1. Download file file using this link:

or use this command:

curl >

If your computer does not trust our server's credentials insert a -k option, such as:

curl -k >

  1. Move the file into the newly created GSAS-II folder
  1. Run the file by double-clicking on it or using the command <path>python <path>
  1. This creates a file that can be used to start GSAS-II either by clicking on the app or by dragging a file onto the app. Note that the app file can be dragged to the doc, but it cannot be moved to another folder. Instead, create an alias and move the alias where desired.

Note that GSAS-II can be updated at any time by reusing the file. This will download any newly created and modify any updated program files.


Since 2013, a script to build an app to run GSAS-II called makeMacApp.pyis supplied. This can be rerun using the appropriate version of Python needed to run GSAS-II with a command like <path>python <path>

Compiling Fortran Code

This step can usually be skipped, unless you have an older computer running OS X 10.4 or a PPC (G4, etc.) CPU.

GSAS-II requires a small number of Fortran routines that are incorporated as Python packages (.so files). GSAS-II provides these for many common Python configurations. If you are using less common options, you may need to compile the Fortran routines yourself using the NumPy f2py routine and the compiler of your choice. Both G77 and GFortran have worked on the Mac.

To help with compiling the programs, use the python scons routine inside the GSASII/fsource directory. If you are lucky, this routine will find the needed compiler and python program, set all options correctly for you and run all steps needed to prepare the .so files. This is done by

(1) opening a Terminal or xterm window,

(2) using the cd command to set your working directory to .../GSASII/fsource and

(3) simply typing "scons" in the window.

If you need to change any options, type "scons help" to see a list of the possible command-line arguments and the values for the options. For testing, help can be used with command-line options to see how they will change the variables.

If you can help expand any of these instructions, discover new mechanisms for installing Python, or have problems getting this to work, please let me know.

Attachments (2)

Download all attachments as: .zip