Ask Your Question
1

imagemagick/animate problem

asked 2012-02-01 21:38:06 +0100

zscool gravatar image

updated 2012-02-01 21:40:48 +0100

I have imagemagick installed on my OS X Snow Leopard machine. When I try to do animation on a notebook on my machine I get the error:

"/tmp/sage-mac-app/local/bin/sage-native-execute: line 8: convert: command not found

Error: ImageMagick does not appear to be installed. Saving an animation to a GIF file or displaying an animation requires ImageMagick, so please install it and try again.

See www.imagemagick.org, for example."

Any idea why this would fail even though the convert command works in my terminal prompt?

edit I should point out that in the terminal session, the show() method does generate a gif with several pictures. In notebook, however, I get the above error.

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
1

answered 2012-02-01 23:13:32 +0100

Shashank gravatar image

How did you install imagemagick? It seems you did not set the PATH and LD_LIBRARY_PATH correctly. Have a look at

http://www.imagemagick.org/script/binary-releases.php?ImageMagick=8t1hubbqi2k49feh51an7g0co4#macosx

Add the lines starting with export to ~/.bash_profile and run the command source ~/.bash_profile

Let me know if this works or if you installed imagemagick some other way.

edit flag offensive delete link more

Comments

Thank you for the response. I installed imgagemagick via macports, I assume it should have installed everything properly, but I'm not sure. Do you have any experience with macports?

zscool gravatar imagezscool ( 2012-02-02 12:50:12 +0100 )edit

Yes I have a mac with snow leopard and i used macports too. All I had to do to make it work was make sure that I set the PATH and LD_LIBRARY_PATH. Did you try adding the paths to .bash_profile?

Shashank gravatar imageShashank ( 2012-02-02 15:24:17 +0100 )edit

I really don't much experience with the linux bash shell. Can you be more specific? I know that macports programs are installed in /opt/local, which is already in my .bash_profile. What else do I need to add?

zscool gravatar imagezscool ( 2012-02-06 10:49:23 +0100 )edit

First and foremost the error you are getting is that the command convert is not found. So the question is if you type convert on terminal do you get an error? If yes then convert is not in PATH. Search where convert is kept. Let us call it path-to-convert. In .bash_profile add the line export PATH=path-to-convert:$PATH. If the command convert is working in the terminal then I am not sure what the problem is.

Shashank gravatar imageShashank ( 2012-02-06 15:15:17 +0100 )edit

Oddly enough, convert does work in the terminal, and a = animate(...), a.show() works in the terminal. The error message I am getting only occurs when I try to call a.show() from a worksheet in the sage notebook on my computer.

zscool gravatar imagezscool ( 2012-02-06 15:40:49 +0100 )edit
1

answered 2012-02-06 15:47:56 +0100

zscool gravatar image

I managed to fix my problem, but I'm not sure why Sage is doing this. I copied convert from /opt/local/bin to /tmp/sage-mac-app/local/bin, and this seemed to do the trick. I'm not really sure why this hack fixed the problem. It seems that Sage should be able to look elsewhere for files.

edit flag offensive delete link more

Comments

That is good to know. I am still surprised that you had to do that.

Shashank gravatar imageShashank ( 2012-02-06 18:13:58 +0100 )edit

I had the exact same problem..SnowLeopard,MacPorts,ImageMagick, ..unix greenie.. all of it... thank you ZSCOOL..your hack worked for me too

John McNally gravatar imageJohn McNally ( 2012-03-05 01:24:59 +0100 )edit

Exact same problem again on two different Macs. OSX 10.6.8 and OSX 10.5. On one, copied convert to /tmp/sage-mac-app/local/bin, on the second, created just a link there to the place where the convert utility sits - both work now! But for the copy approach, I get a default background color of black, which is a problem.

croettger gravatar imagecroettger ( 2012-11-28 15:09:33 +0100 )edit
0

answered 2012-07-12 09:58:15 +0100

Ivan Andrus gravatar image

updated 2012-07-12 09:59:40 +0100

My guess is that /opt/local/bin is not in your PATH for GUI applications. If you open a terminal and start the sage server there, I bet it will work (and I think you indicate that it does).

What happens is that GUI applications (including Sage.app) do not read .bash_profile etc. when they start up so they don't get any changes to PATH made there. You have to edit the file ~/.launchd.conf (10.7+) or ~/.MacOSX/environment.plist and add the correct PATH there. See this stackoverflow answer for details.

This is a very common problem on stackoverflow and similar sites. I wish I could figure out a way to make this easier for people to discover.

edit flag offensive delete link more
0

answered 2012-07-11 21:10:02 +0100

ahausknecht gravatar image

Hi all,

I am running the 64-bit app version Sage 5.1 on a MacBookPro with Mac OS Lion.

I installed ImageMagick and verified that it is working. However, Sage "animate" command reported that ImageMagick must not be installed.

I then copied "convert" to "/tmp/sage-mac-app/local/bin" as suggested above and the "animate" command still failed and reported the error shown below:


dyld: Library not loaded: /ImageMagick-6.7.8/lib/libMagickCore.5.dylib Referenced from: /Applications/Sage-5.1-OSX-64bit-10.6.app/Contents/Resources/sage/local/bin/convert Reason: image not found /Applications/Sage-5.1-OSX-64bit-10.6.app/Contents/Resources/sage/local/bin/sage-native-execute: line 8: 574 Trace/BPT trap: 5 "$@" Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_4.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -- coding: utf-8 -*-\n" + _support_.preparse_worksheet_cell(base64.b64decode("YT1hbmltYXRlKFtzaW4oeCArIGZsb2F0KGspKSBmb3IgayBpbiBzcmFuZ2UoMCwyKnBpLDAuMyldLHhtaW49MCwgeG1heD0yKnBpLCBmaWdzaXplPVsyLDFdKQphLnNob3coKQ=="),globals())+"\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in <module>

File "/private/var/folders/31/r_2f8ryd5ks7xb80nyrbj2cc0000gn/T/tmpS3zCmv/___code___.py", line 4, in <module> exec compile(u'a.show() File "", line 1, in <module>

File "/Applications/Sage-5.1-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/plot/animate.py", line 457, in show self.gif(delay = delay, iterations = iterations) File "/Applications/Sage-5.1-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/plot/animate.py", line 400, in gif raise OSError, msg OSError: Error: Neither ImageMagick nor ffmpeg appears to be installed. Saving an animation to a GIF file or displaying an animation requires one of these packages, so please install one of them and try again. See www.imagemagick.org and www.ffmpeg.org for more information. --------------------------------------------------------------*

I also tried to create a link to "convert " in "/tmp/sage-mac-app/local/bin" but this also failed with an error also stating that "ImageMagick" was not installed.

At this point I don't know what else to try! Is there anyway that ImageMagick could be included in the Sage distributions in the future?

Regards

Adam Hausknecht Department of Mathematics UMass Dartmouth

edit flag offensive delete link more

Comments

Hmm. I thought there might be licensing issues, but a brief perusal of the internet implies not. I have to say that zscool's solution is a hack in any case - a useful one, but we need to fix it elsewhere. My gut says that convert wasn't in your path somehow. Can you amend your answer to include the *original* failure message? That may be helpful. Or you could just start a new question, maybe that would be easier.

kcrisman gravatar imagekcrisman ( 2012-07-11 22:23:42 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-02-01 21:38:06 +0100

Seen: 7,240 times

Last updated: Jul 12 '12