Page 1 of 1

installation

Posted: 2017-10-16T19:22:11-07:00
by jbr
Hi

I am a very new user on Mac (OS HighSierra).I have downloaded and installed ImageMagick-x86_64-apple-darwin16.7.0.tar.gz.
However I get the following error

dyld: Library not loaded: /ImageMagick-7.0.7/lib/libMagickCore-7.Q16HDRI.4.dylib
Referenced from: /Users/jay/Applications/ImageMagick/ImageMagick-7.0.7/bin/convert
Reason: image not found
Abort trap: 6

Any suggestions?
Thanks

Re: installation

Posted: 2017-10-16T19:45:10-07:00
by fmw42
What was your exact command line that gave the error? Note that in IM 7, convert is changed to magick. Try

Code: Select all

magick logo: logo.gif
Does that work?

Also how did you install ImageMagick? If from binary, then the binary is only for Sierra, not High Sierra. See http://www.imagemagick.org/script/download.php#macosx

where it says:

"ImageMagick-x86_64-apple-darwin16.7.0.tar.gz download download macOS Sierra"

You may want to install via Homebrew for IM 7, if they have a version compatible with High Sierra or from Mac Ports with IM 6.

Otherwise, I would suggest you download all your delegates from MacPorts and install IM from source. See viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202 and viewtopic.php?f=2&t=31844

Re: installation

Posted: 2017-10-17T12:03:20-07:00
by jbr
Thanks for your reply.
1. MacBook-Pro-2015:~ jay$ magick logo: logo.gif
dyld: Library not loaded: /ImageMagick-7.0.7/lib/libMagickCore-7.Q16HDRI.4.dylib
Referenced from: /Users/jay/Applications/ImageMagick/ImageMagick-7.0.7/bin/magick
Reason: image not found
Abort trap: 6
so suggestion #1 didn't work.

2. I did download the binary for macOS Sierra so this could be the issue as i have High Sierra

3. I couldn't tell from the Home-brew page if they were High Sierra compatible. In any case not sure what commands I would issue as I haven't used this before.

4. I am not savvy enough to be downloading from source.

Re: installation

Posted: 2017-10-17T12:32:08-07:00
by jbr
Here is the code that I used in my failed installation

MacBook-Pro-2015:Applications jay$ export PATH="/Users/jay/Applications/ImageMagick/bin:$PATH"
MacBook-Pro-2015:Applications jay$ export DYLD_LIBRARY_PATH="/Users/jay/Applications/ImageMagick/lib/"
MacBook-Pro-2015:Applications jay$ magick logo: logo.gif
dyld: Library not loaded: /ImageMagick-7.0.7/lib/libMagickCore-7.Q16HDRI.4.dylib
Referenced from: /Users/jay/Applications/ImageMagick/ImageMagick-7.0.7/bin/magick
Reason: image not found
Abort trap: 6
MacBook-Pro-2015:Applications jay$

Re: installation

Posted: 2017-10-17T14:56:09-07:00
by fmw42
2. I did download the binary for macOS Sierra so this could be the issue as i have High Sierra
This is the issue. You need to get a High Sierra download from Homebrew for IM 7 or one from MacPorts for IM 6.

Try installing from Homebrew and see if that works. I do not see where it says anything about High Sierra. But that is very new and perhaps no one has a binary install for ImageMagick for it yet.

Re: installation

Posted: 2017-10-26T23:49:59-07:00
by hobonichi
Hi all,

I've successfully installed ImageMagick 7.0.7 on MacOS Sierra 10.12.6 and have the environment variables set. Currently I'm able to run magick command correctly in terminal directly, but when I run the exact same command from python (using subprocess.Popen().communicate()), I got the exact error of

dyld: Library not loaded: /ImageMagick-7.0.7/lib/libMagickCore-7.Q16HDRI.4.dylib
Referenced from: /Users/hobonichi/Applications/ImageMagick/ImageMagick-7.0.7/bin/convert
Reason: image not found
Abort trap: 6

I think this is due to missing env_var of $DYLD_LIBRARY_PATH, so I tried set it within python subprocess call and even set it in .bash_profile which made this env_var available globally in all terminal processes, but still see the exact same error.

I understand my problem is more related to python instead of IM, but I didn't google any other threads that's more relevant on this error :(

Thanks in advance!!

Re: installation

Posted: 2017-10-27T09:53:04-07:00
by fmw42
Did you provide the full path the magick in your python subprocess?

Re: installation

Posted: 2017-10-27T10:51:28-07:00
by hobonichi
Yes I did. I used the absolute path that points to magick that I'm using. Got no luck still on setting env var for python subprocess, so now I'm trying to build ImageMagick from source and package it.

Re: installation

Posted: 2017-10-27T11:39:07-07:00
by fmw42
Unfortunately, I am just a beginner using Python with Skimage and OpenCv. I know about the subprocess but have had no experience using it.

If you want to use ImageMagick from Python, you might want to just install the python wand tool. See http://docs.wand-py.org/en/0.4.4/

Or

PythonMagick -- see https://www.imagemagick.org/download/python/

Re: installation

Posted: 2017-10-27T15:27:52-07:00
by fmw42
I have just now played around with subprocess module in Python using ImageMagick 6.9.9.20 Q16 Mac OSX Sierra. Both of the following work for me. See http://www.bogotobogo.com/python/python ... module.php

These are the two scripts (on my desktop)

subprocess_convert1.py

Code: Select all

#!/opt/local/bin/python3.6

import subprocess

cmd = ['/usr/local/bin/convert','-size','30x40','xc:white','-fill','white','-fill','black','-font','Arial','-pointsize','40','-gravity','South','-draw',"text 0,0 'P'",'/Users/fred/desktop/draw_text1.gif']

subprocess.call(cmd, shell=False)

subprocess_convert2.py

Code: Select all

#!/opt/local/bin/python3.6

import subprocess

cmd = '/usr/local/bin/convert -size 30x40 xc:white -fill white -fill black -font Arial -pointsize 40 -gravity South -draw "text 0,0 \'P\'" /Users/fred/desktop/draw_text2.gif'

subprocess.call(cmd, shell=True)
They are called in a bash shell terminal with:

Code: Select all

python3.6 subprocess_convert1.py

or

python3.6 subprocess_convert2.py
They both result in

Image