Skip to content Skip to sidebar Skip to footer

Get Error When Importing Funcanimation From Matplotlib.animation

I can't import FuncAnimation from matplotlib.animation. When I try to do it I get the error : ValueError: insecure string pickle I use matplotlib 1.5.1, Python 2.7, Mac OSX 10.1

Solution 1:

Ah, I found the problem (for my install):

brew install imagemagick

I dug into the errors python was showing ...

$ python -c "import matplotlib.animation" 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/matplotlib/animation.py", line 578, in <module>
    class ImageMagickWriter(MovieWriter, ImageMagickBase):
  File "/usr/local/lib/python2.7/site-packages/matplotlib/animation.py", line 74, in wrapper
    if writerClass.isAvailable():
  File "/usr/local/lib/python2.7/site-packages/matplotlib/animation.py", line 277, in isAvailable
    creationflags=subprocess_creation_flags)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1334, in _execute_child
    child_exception = pickle.loads(data)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1388, in loads
    return Unpickler(file).load()
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 864, inload
    dispatch[key](self)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 972, in load_string
    raise ValueError, "insecure string pickle"
ValueError: insecure string pickle
$

And noticed ImageMagick was being used. Given the comments in this thread ... https://github.com/matplotlib/matplotlib/issues/5314#issuecomment-225368342 ... about missing dependencies, I installed ImageMagick and the issue went away.

Post a Comment for "Get Error When Importing Funcanimation From Matplotlib.animation"