Search code examples
homebrewgdaltopojson

Homebrew cannot link libpng trying to install gdal


I'm trying to install gdal via homebrew so I can start working with topojson, but I keep getting this error and I'm not sure how to resolve it?

k-6177:Cellar k$ brew install gdal
==> Installing dependencies for gdal: libpng, giflib, libtiff, lzlib, proj, libgeotiff, geos, sqlite, freexl, libxml2, json-c, liblwgeom, libspatialite
Error: Cannot link libpng
Another version is already linked: /usr/local/Cellar/libpng/1.6.16

Solution

  • Looks like I just needed to change some permissions. I used the following command:

    sudo chown -R $(whoami):admin /usr/local