OSGeo / homebrew-osgeo4mac

Mac homebrew tap for maintaining a stable work environment for the OSGeo.org geospatial toolset
https://git.io/fhh3X
BSD 3-Clause "New" or "Revised" License
364 stars 111 forks source link

dyld version incorrect on Mavericks clean install #48

Closed mhkeller closed 9 years ago

mhkeller commented 10 years ago

I'm installing the qgis-24 formula on a clean install of mavericks. I installed XCode and then:

sudo easy_install pip
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew doctor
brew tap osgeo/osgeo4mac
brew install qgis-24
# It then told me I needed XQuartz so I installed that from xquartz.macosforge.org and ran the last line again

The installation finished with with one warning.

Warning: inreplace in `/usr/local/Cellar/qgis-24/2.4.0_2/QGIS.app/Contents/Resources/python/plugins/processing/algs/grass/GrassUtils.py' failed
Expected replacement of `/Applications/GRASS-6.4.app/Contents/MacOS' with '/usr/local/opt/grass-64/grass-base'

Running this line...

/usr/local/opt/qgis-24/bin/qgis

gives me this error...

dyld: Library not loaded: /usr/local/opt/qgis-24/bin/qgis
    Referenced from: /usr/local/opt/qgis-24/QGIS.app/Contents/MacOS/QGIS
    Reason: Incompatible library version: QGIS requires version 8.0.0 or later, but libexpat.1.dylib provides version 7.0.0

The install gives me the warning that I should also install psycopg2 and pyparser. Running pip install psycopg2 and pip install pyparser and then running the above command to launch qgis gives me the same error.

Running brew doctor suggesting running brew link python and adding /usr/local/bin ahead of /usr/local/bin. I did both of those things, resourced my bash profile and now brew doctor says ready to brew. But I'm still getting the same error when launching qgis. I've also verified that qscintilla2 is linked.

If there are other logs to look at, please let me know what you would need.

Sorry for any typos in the error messages — my VirtualBox doesn't want to let me share clipboards despite my insistence to do so.

UPDATE: Here's my output from running

brew gist-logs --config --doctor qgis-24

https://gist.github.com/anonymous/8d3d0f5241fc0f129aba

dakcarto commented 9 years ago

Hi,

Please try the following, if you have time:

brew update
brew reinstall expat
brew upgrade qgis-24

You are using Homebrew's Python, so upgrading qgis-24 should pour a fresh bottle for you (no source build needed, unless you specify non-default options).

Note: expat was previously linked to HOMEBREW_PREFIX, but is now keg-only. So, reinstalling it should clean up your brew doctor output as well.

mhkeller commented 9 years ago

It's now running but it appears the bottle failed and it's now building from source. Just to double check, I don't have to run any of those flags as described in the expat caveats, correct? I had the same session open from before on my virtual machine but should I have run brew tap osgeo/osgeo4mac again before brew reinstall expat?

Thank you for your help.

Mavs-MacBook-Pro:~ mav$ brew update
Updated Homebrew from b8b1f1b5 to 8202a3b8.
==> New Formulae
bokken             cwm            makeself           ttylog
csfml              homebrew/science/adam  sync_gateway
==> Updated Formulae
android-ndk         elixir          icecast             nmap            squid
android-sdk         fits            imagemagick         node            svtplay-dl
app-engine-java-sdk     fleetctl            jam             open-sp         syncthing
apt-cacher-ng           gcc             juju                osgeo/osgeo4mac/qgis-24 tarsnap
aspcud              gettext         jython              percona-server      tig
avrdude             git-cola            libtins             pianobar            unrar
bind                glew            libunistring            profanity           vim
boot2docker         go-app-engine-32        libvirt             proxychains-ng      yaws
cayley              go-app-engine-64        lmdb                rcssserver          youtube-dl
cgvg                google-app-engine       logstash            readline            zookeeper
clasp               gpsd            lv              remctl          zsh
cmocka              gradle          mecab-ko            scrypt
concurrencykit          graphicsmagick      mongodb             sfml
cowpatty            gringo          mpd             spiped
eigen               homebrew/science/primer3    mpdviz              sqlitebrowser
==> Deleted Formulae
rcsslogplayer  rcssmonitor
Mavs-MacBook-Pro:~ mav$ brew reinstall expat
==> Reinstalling expat
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/expat-2.1.0.mavericks.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/expat-2.1.0.mavericks.bottle.tar.gz
==> Pouring expat-2.1.0.mavericks.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

OS X includes Expat 1.5.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/expat/lib
    CPPFLAGS: -I/usr/local/opt/expat/include

==> Summary
🍺  /usr/local/Cellar/expat/2.1.0: 11 files, 412K
Mavs-MacBook-Pro:~ mav$ brew upgrade qgis-24
==> Upgrading 1 outdated package, with result:
qgis-24 2.4.0_3
==> Upgrading qgis-24
==> Downloading http://qgis.dakotacarto.com/osgeo4mac/bottles/qgis-24-2.4.0_3.mavericks.bottle.tar.gz

curl: (22) The requested URL returned error: 403 Forbidden
Error: Failed to download resource "qgis-24"
Download failed: http://qgis.dakotacarto.com/osgeo4mac/bottles/qgis-24-2.4.0_3.mavericks.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Installing qgis-24 dependency: bison
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/bison-3.0.2.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring bison-3.0.2.mavericks.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

Some formulae require a newer version of bison.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/bison/lib

==> Summary
🍺  /usr/local/Cellar/bison/3.0.2: 37 files, 2.0M
==> Downloading https://github.com/qgis/QGIS/archive/final-2_4_0.tar.gz
######################################################################## 100.0%
dakcarto commented 9 years ago

Seems the S3 bucket permissions for the newly uploaded bottle were not world-readable. Sorry about that. Should be good now.

The noted caveats for expat should have no bearing on using it with qgis-24. When adding a dependency in another formula, Homebrew handles the appropriate make flags (or CMake prefixes in this case). You would need to follow the caveats' suggestion if you were building outside of Homebrew, e.g. building QGIS manually and using Homebrew's installs for dependencies, like is done when creating a QGIS dev setup.

mhkeller commented 9 years ago

Got it. Should I wait for the source installation to finish before trying again or could I ctrl-c it safely? It probably has a few more hours to go.

mhkeller commented 9 years ago

Nevermind. It just finished.

I did

pip install matplotlib
brew linkapps

And launched it from /Applications. Thanks for the help.

dakcarto commented 9 years ago

No problem. You may wish to do brew linkapps --local instead, so symlinks are placed in ~/Applications. This would allow you to install QGIS from Kyngchaos.com, if needed, for example.

mhkeller commented 9 years ago

Thanks -- that's a good idea. I saw --local as an option there but couldn't find documentation on what that flag did exactly.

dakcarto commented 9 years ago

Check out man brew for docs on brew core commands.

mhkeller commented 9 years ago

Thanks!

mhkeller commented 9 years ago

Quick question: I'm installing this on a fresh computer today. How would I have avoided my error the first time?

Should I run brew update right after installing brew and then run brew doctor to make sure everything is set up propertly?

dakcarto commented 9 years ago

Yes, that sounds like the best approach for a new brew install in general. It should be listed on the installation pages (maybe I missed it), but is the first bit in Troubleshooting section of the wiki.