Yikes! That is a nasty thing. Can you give us more details? I think we do assume libpng is on the system, but I don't know that we verify the "right" version. Maybe we need to check this :(
kcrisman (Jul 13 '12)| Hi all, I have installed the both the app version and the command line version of the Sage 5.1 on a MacBook Pro running Lion. Also, I have installed the most recent version of ImageMagick and I've set the environment variables as suggested at the ImageMagick website. I also checked that ImageMagick is working! Sage's 'animate' command fails when invoking either version of Sage 5.1 from the command line and then entering "notebook" command to start the browser version of Sage. The example is the first one in the 'Animate Plots' section of the Sage's 'Help': a = animate([circle((i,i), 1-1/(i+1), hue=i/10) for i in srange(0,2,0.2)], xmin=0,ymin=0,xmax=2,ymax=2,figsize=[2,2]) a.show() # optional -- ImageMagick Below is the error that is reported by Sage: ============================================================================
convert: memory allocation failed File "/private/var/folders/31/r_2f8ryd5ks7xb80nyrbj2cc0000gn/T/tmpyUOMOA/___code___.py", line 5, in <module> exec compile(u'a.show() # optional -- ImageMagick File "", line 1, in <module> File "/Applications/Sage/local/lib/python2.7/site-packages/sage/plot/animate.py", line 457, in show self.gif(delay = delay, iterations = iterations) File "/Applications/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.This might be a permissions error (which causes the images not to be generated) or perhaps a 64bit vs 32bit lib error. I am not sure! Note that if the app version of Sage is invoked, Sage is unable to find ImageMagick's "convert" command. In a previous response to a similar question it was suggested that one should modify the "environment.plist" file to set the environment variables rather than the ".bash_profile file". However, the problem above seems to be more serious than just finding ImageMagick. In any case, there should be a better fix than this! An average user should not be expected to make such changes in their systems! In future versions of Sage could ImageMagick (or an equivalent) be bundled with Sage? Regards, Adam Hausknecht Department of Mathematics UMass Dartmouth asked Jul 13 '12 This post is a wiki. Anyone with karma >150 is welcome to improve it. |
| Hi all, I tried Ivan Andrus's suggestion (see above) and have discovered that there is a problem with the latest version of ImageMagick. When I downgraded to "ImageMagick-6.7.5" from "ImageMagick-6.7.8" (the current version), the "animate" does work in Sage 5.1 when Sage is started from the Terminal ! It seems that "ImageMagick-6.7.8 was built against a different version of "libpng" than was "ImageMagick-6.7.5" and this is causing the memory errors. Thanks and regards, Adam Hausknecht Department of Mathematics UMass Dartmouth answered Jul 13 '12 This post is a wiki. Anyone with karma >150 is welcome to improve it. Yikes! That is a nasty thing. Can you give us more details? I think we do assume libpng is on the system, but I don't know that we verify the "right" version. Maybe we need to check this :( kcrisman (Jul 13 '12) |
Asked: Jul 13 '12
Seen: 125 times
Last updated: Jul 13 '12
powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.
It works for me using Snow Leopard and ImageMagick installed via home brew. You can see if it's a permissions issue by checking permissions of
Ivan Andrus (Jul 13 '12)sage.misc.misc.tmp_dir(). That should also help find the generated pngs (they will be in a sibling directory) and you can see if they are corrupted. I would also try runningconvertfrom withinsage -shsince that should mimic the environment used by sage. You may need to usesage-native-execute convert ...to reset PATH, and LD_LIBRARY_PATH, etc.