QGIS Installation – How to Set Up QGIS on Mavericks Using Homebrew on Mac

homebrewinstallationmacqgis

I have been trying to install QGIS on Mavericks and I have failed.
Prior to installing QGIS, I installed GDAL using homebrew.
I also installed Numpy, SciPy and pyqt using the detailed instructions provided at:
http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/

I modified my .bash_profile so that when I run echo $PYTHONPATH

I get /usr/local/lib/python2.7/site-packages:

I tried first installing qgis running

brew install qgis --with-grass --with-postgis

and I get the error message

libtool: link: cannot determine absolute directory name of `@@HOMEBREW_CELLAR@@/libpng/1.5.17/lib'
make[3]: *** [libcairo.la] Error 1
make[2]: *** [install] Error 2
make[1]: *** [install-recursive] Error 1
make: *** [install] Error 2

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting

These open issues may also help:
    https://github.com/Homebrew/homebrew/issues/3526
    https://github.com/Homebrew/homebrew/pull/23375
    https://github.com/Homebrew/homebrew/issues/20522
    https://github.com/Homebrew/homebrew/pull/23252
    https://github.com/Homebrew/homebrew/issues/16361
    https://github.com/Homebrew/homebrew/pull/18528

Then I also tried downloading the QGIS .dmg file from http://www.kyngchaos.com/software/qgis However, I get an error message each time I try opening Install QGIS.pkg saying that I need matplotlib that I already have!

Is anyone else also having problems installing QGIS on Mavericks? Does anyone know how to solve it?

Best Answer

You are trying to mix different things:

1) You want to use the Homebrew version of QGIS:
  • Everything must be installed by Homebrew as binaries and libraries in /usr/local/Cellar with symbolic links in /usr/local/bin, GDAL/OGR, QGIS, ....

  • the Homebrew QGIS version uses the Homebrew Python version with modules in /usr/local/lib/python2.7/site-packages

  • All the Python modules you have installed (Numpy, SciPy pyqt...), works only with the Homebrew version of Python

  • If it doesn't work, it is the problem of Homebrew (can find libpng library, for example)

2) you want to use the Kyngchaos's version of QGIS
  • You should install his versions of the libraries ( Unix Compatibility Frameworks (KyngChaos) ) which are installed as Frameworks in /Library/Frameworks).
  • The QGIS version uses the Apple Python with modules in /Library/Python/2.7/site-packages
  • If you don't know Python you can download the Python modules at Python Modules (KyngChaos)
  • the installer examine whether there is a folder named "matplotlib" in /Library/Python/2.7/site-packages. If not, no installation (even if matplotlib is installed in /usr/local/lib/python2.7/site-packages)
3) if you want, you can also use the MacPorts version of QGIS
  • with the Python version of MacPorts (in /opt), and so on.
4) conclusions

So you have to choose between 2 solutions (Homebrew and Kyngchaos) without mixing them ( unless you know UNIX path manipulation very, very well ).

And the people using the Kyngchaos version do not experience any problem.

Related Question