Skip to content

Instantly share code, notes, and snippets.

@gjoseph92
Last active September 8, 2018 22:27
Show Gist options
  • Save gjoseph92/7e895e6832c1fcea16d976b03d57ec8b to your computer and use it in GitHub Desktop.
Save gjoseph92/7e895e6832c1fcea16d976b03d57ec8b to your computer and use it in GitHub Desktop.
macOS: install QGIS 3 without trashing your python/dev environment

Installing QGIS 3.2 on macOS for the paranoid

So you have your development environment carefully set up, with pyenv or conda to manage multiple versions of Python and multiple virtual environments for different projects, and just the right version of GDAL installed, and you can even import gdal without everything blowing up.

You want QGIS, but you don't want to ruin this careful tower of babel and be left unable to build anything with GDAL dependencies or run the right Python versions.

Turns out, using the packaged installers for QGIS will work just fine—because they install everything as macOS frameworks, which won't interact with the rest of your environment.

Steps:

  1. Download the macOS Python 3.6 installer from python.org.

Yes. This is actually necessary even if python --version is already 3.6, and it won't mess anything up. Their package installs Python as a framework—nothing ends up in /usr/bin—as long as you follow the next step:

  1. Run the installer. On the "Installation Type" page, click Customize. Uncheck every box except "Install or upgrade pip".

Then click Install. What will happnen: you'll just end up with Python.framework in /Library/Frameworks. The python3.6 and pip3 binaries will be in /Library/Frameworks/Python.framework/Versions/3.6/bin, but since you unchecked "UNIX command-line tools", they aren't symlinked anywhere. Horray—totally isolated.

  1. Download the QGIS macOS installer disk image and open it.

  2. Just run the installers in order. First "2 Install GDAL Complete.pkg", then "3 Install QGIS 3.pkg".

The GDAL installer will just install macOS frameworks in /Library/Frameworks. There should be no interaction with your existing installations.

  1. Open /Applications/QGIS3.app and watch it actually work!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment