homebrew-osgeo4mac: QGIS doesn't start after upgrade: "dyld: Library not loaded: /usr/local/opt/osgeo-proj/lib/libproj.13.dylib"

Please answers the following

I’ve…

  • I read
  • I checked the documentation and found no answer
  • I tried to install after following the suggestions
  • I am running the latest version (brew update twice?)
  • I checked to make sure that this issue has not already been filed
  • I uploaded logs: brew gist-logs formula

Describe the bug

I run brew upgrade yesterday without getting any error but after finishing upgrading I was not able to run QGIS again.

When I run from terminal /usr/local/opt/osgeo-qgis/bin/osgeo-qgis I get:

dyld: Library not loaded: /usr/local/opt/osgeo-proj/lib/libproj.13.dylib Referenced from: /usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/QGIS Reason: image not found /usr/local/opt/osgeo-qgis/bin/osgeo-qgis: line 20: 41976 Abort trap: 6 /usr/local/opt/osgeo-qgis/QGIS.app/Contents/MacOS/QGIS “$@”

I reinstalled QGIS following all the instructions but I’m still getting the same error.

Any idea what can be the problem?

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 7
  • Comments: 39

Most upvoted comments

I am new to compile osgeo4mac but i cant do that. I took Dyld Error Message: Library not loaded: /usr/local/opt/osgeo-proj/lib/libproj.13.dylib Referenced from: /usr/local/Cellar/osgeo-qgis-ltr/3.4.9/QGIS.app/Contents/MacOS/QGIS Reason: no suitable image found. Did find: /usr/local/opt/osgeo-proj/lib/libproj.13.dylib: stat() failed with errno=20 error. Firstly, I have “libproj.15.dylib” error. After that, I downloaded bottle related with “libproj.13.dylib” manually from @jonathanmccormack link (5.2 mojave version) . Now, I took that error. I am really rookie around here. Please excuse me ^^

To clarify @berkayoruc, I had to unlink and reinstall several other packages from the older versions in the repository to get QGIS to start:

brew unlink osgeo-gdal osgeo-proj osgeo-libspatialite osgeo-gdal-python
brew install https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/f6e7b27c7485afbdc5a8d9844231fd2e64f02659/Formula/osgeo-gdal.rb
brew install https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/b37f82142e347c293cf0b7992f6187d40116b2ca/Formula/osgeo-proj.rb
brew install https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/27f4ac2bc4056750307cee1b7a6abb9e33c846dd/Formula/osgeo-libspatialite.rb
brew install https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/de5db18027bc37cd3bb0d4be07f59fdc8fe55df9/Formula/osgeo-gdal-python.rb

I could upload poured versions from Mojave so you could manually uncompress them in their respective directories and then run brew switch. Just let me know if you interested in and which packages you would need.

Thanks, but no need this time – I was able to install directly from the commit history. E.g., for osgeo-gdal 2.4.1:

brew unlink osgeo-gdal
brew install https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/f6e7b27c7485afbdc5a8d9844231fd2e64f02659/Formula/osgeo-gdal.rb

I don’t mean to criticize @fjperini or anyone else putting in the hard work to update the formulas, but wouldn’t it be better to hold back on merging in the updates to, e.g., osgeo-proj, osgeo-gdal, etc. until all of the formulas that depend on those have been updated and are ready to be merged in? That would avoid the situation we find ourselves in every time these are updated.

Before I would’ve just run brew switch osgeo-gdal 2.4.1 etc., but combined with the change in Homebrew to automatically run brew cleanup when upgrading unless the HOMEBREW_NO_INSTALL_CLEANUP environment variable is set, even brew switch was unavailable to me this time.

I can confirm it happens on a fresh install as well. It seems like a library mismatch. QGIS was built with older versions of PROJ and GDAL. It’s expecting libproj.13.dylib and libgdal.20.dylib, however both of those packages have been upgraded to libproj.15.dylib and libgdal.26.dylib.

It happened, despite the will to control all the workflow, moving every dependency under one tap, against the efforts and the will of the meritorious contributors to this tap, it happened. I think something is due to the model, the rolling version, that is the reason for Homebrew, something is due to the absence of a software automation testing. Anyway there is a logic failure that is worsened by the general authoritative approach of the leading Homebrew members. The “fork” of some of the formulas began with the decision that everything should be upgraded to Qt 5 that became the new Qt while Qt 4 was deprecated and evicted from the core repository. Anyway, still thanking all the group, I think Rob is right, keeping all the eggs under one hen doesn’t seem a solution per se and it’s not a substitute for automated software management. This said, what’s next? Version 3.8.3 should find it’s way out with with GDAL 3.1 and proj 6 before version 3.10? A proper (temporary?) substitution is the official installer (by Lutra, based on Homebrew) or KingChaos’ one (more advanced, already to version 3.8.3).

On Wed, Oct 9, 2019 at 6:28 PM Rob Howard notifications@github.com wrote:

This situation is absolutely maddening! Why would you dump updates willy-nilly into a tap that is used by people in production environments? All of these changes should have been queued in a separate branch and merged at once to prevent dependency-related breakages from occurring. To compound matters, no officially supported means of downgrading to working packages appears to exist!

For now, are we to assume that @jonathanmccormack https://github.com/jonathanmccormack’s recommendation is the best way to deal with these breakages?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OSGeo/homebrew-osgeo4mac/issues/1261?email_source=notifications&email_token=ACFBXRDZUGGWX2IQU2UENN3QNYBBXA5CNFSM4IWLEOH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAYPMCQ#issuecomment-540079626, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFBXRBIUI62OYGFG2HUDS3QNYBBXANCNFSM4IWLEOHQ .

Carlo A. Bertelli Charta servizi e sistemi per il territorio e la storia ambientale srl Dipendenze del palazzo Doria, vc. alla Chiesa della Maddalena 9/2 16124 Genova (Italy) tel./fax +39(0)10 2475439 +39 0108566195 mobile:+39 393 1590711 e-mail: bertelli@chartasrl.eu http://www.chartasrl.eu

@varoudis osgeo-qgis is being updated these days and it shouldn’t take much longer. In the meantime, you could try the cask version as a workaround in order to get the toolbox working: brew cask install qgis.

I am new to compile osgeo4mac but i cant do that. I took Dyld Error Message: Library not loaded: /usr/local/opt/osgeo-proj/lib/libproj.13.dylib Referenced from: /usr/local/Cellar/osgeo-qgis-ltr/3.4.9/QGIS.app/Contents/MacOS/QGIS Reason: no suitable image found. Did find: /usr/local/opt/osgeo-proj/lib/libproj.13.dylib: stat() failed with errno=20 error. Firstly, I have “libproj.15.dylib” error. After that, I downloaded bottle related with “libproj.13.dylib” manually from @jonathanmccormack link (5.2 mojave version) . Now, I took that error. I am really rookie around here. Please excuse me ^^

To clarify @berkayoruc, I had to unlink and reinstall several other packages from the older versions in the repository to get QGIS to start:

brew unlink osgeo-gdal osgeo-proj osgeo-libspatialite osgeo-gdal-python
brew install https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/f6e7b27c7485afbdc5a8d9844231fd2e64f02659/Formula/osgeo-gdal.rb
brew install https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/b37f82142e347c293cf0b7992f6187d40116b2ca/Formula/osgeo-proj.rb
brew install https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/27f4ac2bc4056750307cee1b7a6abb9e33c846dd/Formula/osgeo-libspatialite.rb
brew install https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/de5db18027bc37cd3bb0d4be07f59fdc8fe55df9/Formula/osgeo-gdal-python.rb

I dont believe this works anymore. It did work for me with two systems, 2 weeks ago, but now I still get an error on another machine.

dyld: Library not loaded: /usr/local/opt/spatialindex/lib/libspatialindex.5.dylib Referenced from: /usr/local/Cellar/osgeo-qgis/3.8.0_1/QGIS.app/Contents/MacOS/./QGIS Reason: image not found fish: './QGIS' terminated by signal SIGABRT (Abort)

Alternatively, you can usually just download the old bottles directly: https://bottle.download.osgeo.org

As far as I can tell, older bottles are kept around for at least a few versions. I find that, if I have to install an older version, it’s cleanest to install from the prior version’s formula, which you can do by providing the raw version from a previous commit. Doing so in this case, homebrew just poured the 2.4.1 bottle from the bottles URL and I was good to go.

@songololo This tap predates the cask version, which was release in late 2018. Before that, the tap was probably the easiest way to get QGIS running in macOS and keep it updated. As for now and as far as I understand, the cask version is based in the homebrew tap, so there isn’t a big difference and both should have the same update pace too. It’s true the cask version is ahead now though.

I would say the advantage of the package over the tap is the installation process, which is quite straight and you don’t need to care about dependencies. You can read more in this QGIS blog entry.

@varoudis osgeo-qgis is being updated these days and it shouldn’t take much longer. In the meantime, you could try the cask version as a workaround in order to get the toolbox working: brew cask install qgis.

Thanks. Its ok for now (at least on my Macs) thanks to the team for all the hard work

dyld: Library not loaded: /usr/local/opt/spatialindex/lib/libspatialindex.5.dylib Referenced from: /usr/local/Cellar/osgeo-qgis/3.8.0_1/QGIS.app/Contents/MacOS/./QGIS Reason: image not found fish: './QGIS' terminated by signal SIGABRT (Abort)

Something like this should downgrade spatialindex back to v1.9.0 from current v1.9.3…

brew unlink spatialindex
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/ff7b5ee0ea31d7af9c4561e20783a1997fb7dbaf/Formula/spatialindex.rb
brew pin spatialindex

Thanks to @jonathanmccormack, it has been possible to get a new installation up and running.

Thanks to the creators and maintainers for making this tap available.

Per the above comments and ongoing brew chaos, is there anyway to create a stable Formula somewhere so that we can reliably install QGIS without constantly running into new issues?

Hi folks, big fan of the the osgeo homebrew qgis keg…any chance you could provide a rough estimate when those dependencies will be update? Also, is there anything someone who has this issue but isn’t a software development pro can do to help? Thanks again for all of your hard work on this!

Thank you @jonathanmccormack it worked! I took another error while opening QGIS, but it is about “processing toolbox”. Even error was occured, QGIS was opened.

@jonathanmccormack I agree with you that we should find a way to release all upgraded packages at the same time or to keep older versions available until deployment is completed in order to avoid these issues. If not, it can be challenging to use the tap in production.

I could upload poured versions from Mojave so you could manually uncompress them in their respective directories and then run brew switch. Just let me know if you interested in and which packages you would need.

You are right. We are in the middle of the upgrade process to new Proj and GDAL versions, so we’ll get these issues until all packages are successfully done.