Anaconda Python 3

One of the easiest ways to install a Python 3 distribution on MacOSX with most of the needed libraries for iSpec is by using Anaconda.


Follow the instructions, anaconda will be installed in /home/your_user/anaconda3/ by default. The installer will ask if you want to initialize/modify .bashrc or .bash_profile, select 'yes'. The installer should have added to your .bashrc or .bash_profile files (in your home directory) something like this:

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/your_user/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
    if [ -f "/home/your_user/anaconda3/etc/profile.d/" ]; then
        . "/home/your_user/anaconda3/etc/profile.d/"
        export PATH="/home/your_user/anaconda3/bin:$PATH"
unset __conda_setup
# <<< conda initialize <<<
  • Close all the terminals and open a new one in order to re-load this new setup.

  • Install a library that does not come by default and that it is needed by iSpec:

conda update conda
conda update --all
conda install lockfile dill
  • Download the latest version of Xcode using the Mac App Store. Once you have Xcode installed, open a terminal, run xcode-select --install, and click the Install button to install the required command line developer tools. Don't worry if you see a message telling you the software cannot be installed because it is not currently available from the Software Update Server. This usually means you already have the latest version installed. Once installed, verify that this version of gcc is the one being executed from your terminal:
which gcc
gcc --version

which should show something similar to:

Configured with: --prefix=/Applications/ --with-gxx-include-dir=/Applications/
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.6.0
Thread model: posix
InstalledDir: /Applications/
  • Install the official gfortran binaries, the latest verified version was gfortran 12.2. Once installed, verify that this version of gfortran is the one being executed from your terminal:
which gfortran
gfortran --version

which should show:

GNU Fortran (GCC) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
  • Finally, download iSpec source code, decompress it and move to $HOME/iSpec/. Open a terminal in the iSpec directory and run:
make clean
make spectrum
make turbospectrum
make moog