Python & MoviePy vector graphics test

Author’s blog post about using MoviePy to animate vector graphics here
MoviePy PyPi page here
Gizeh GitHub page here

Installation PyPi page they state to install MoviePy simply by: pip install moviepy
..not that fast bro, MoviePy 1.0 runs only on python 3, so i had to use older version for my rusty old python 2.7.. sudo pip install moviepy==
Successfully installed moviepy decorator imageio tqdm enum34 futures
Cleaning up...

well..that worked, but package itself uses lots of other packages to work..
..on Linux Mint 17.3 i went into dependency hell, have a good luck trying.. run examples i had to install gizeh..
sudo pip install gizeh

RuntimeError: cairocffi does not support Python 2.x anymore. Please use Python 3 or install an older version of cairocffi.

solved by using older version: sudo pip install cairocffi==0.9.0

trying to run examples from authors blog:
from moviepy.editor import *
File "/usr/local/lib/python2.7/dist-packages/moviepy/", line 26, in
File "/usr/local/lib/python2.7/dist-packages/imageio/plugins/", line 40, in download
" has been deprecated. "
RuntimeError: has been deprecated. Use 'pip install imageio-ffmpeg' instead.'

solution found here
sudo pip install imageio==2.4.1

problems with pillow setup:
had to manually install package „libjpeg-dev“ via sudo apt-get install libjpeg-dev or installation failed

another problem right on:
ImportError: Imageio Pillow requires Pillow, not PIL!

so i tried:
sudo pip install pillow
Requirement already satisfied (use --upgrade to upgrade): pillow in /usr/lib/python2.7/dist-packages
Cleaning up...


found issue:
being rather issue of imageio:

– yes, there is no pillow there 😀
oh really?

sudo pip install --target=/usr/local/lib/python2.7/dist-packages/ --upgrade pillow
version Pillow 6.0.0
platform linux2 2.7.6 (default, Nov 23 2017, 15:49:48)
[GCC 4.8.4]
Successfully installed pillow
Cleaning up..

would the example from author’s blog post work after all this? of course NOT 😀

[MoviePy] Building file circle.gif with imageio
0%| | 0/31 [00:00
Traceback (most recent call last):
File "/home/k/Plocha/PYTHON/MOVIEPY_TESTS/", line 18, in
clip.write_gif("circle.gif",fps=15, opt="OptimizePlus", fuzz=10)
File "</usr/local/lib/python2.7/dist-packages/decorator.pyc:decorator-gen-56>", line 2, in write_gif
File "/usr/local/lib/python2.7/dist-packages/moviepy/", line 54, in requires_duration
return f(clip, *a, **k)
File "</usr/local/lib/python2.7/dist-packages/decorator.pyc:decorator-gen-55>", line 2, in write_gif
File "/usr/local/lib/python2.7/dist-packages/moviepy/", line 22, in convert_masks_to_RGB
return f(clip, *a, **k)
File "/usr/local/lib/python2.7/dist-packages/moviepy/video/", line 456, in write_gif
File "/usr/local/lib/python2.7/dist-packages/moviepy/video/io/", line 293, in write_gif_with_image_io
File "/usr/local/lib/python2.7/dist-packages/imageio/core/", line 500, in append_data
return self._append_data(im, total_meta)
File "/usr/local/lib/python2.7/dist-packages/imageio/plugins/", line 113, in _append_data
self._writer.add_image(im, duration, dispose)
File "/usr/local/lib/python2.7/dist-packages/imageio/plugins/", line 165, in add_image
im_pil = self.converToPIL(im_rect, self.opt_quantizer, self.opt_palette_size)
File "/usr/local/lib/python2.7/dist-packages/imageio/plugins/", line 353, in converToPIL
im_pil = ndarray_to_pil(im, "gif")
File "/usr/local/lib/python2.7/dist-packages/imageio/plugins/", line 645, in ndarray_to_pil
array_buffer = arr.tobytes()
AttributeError: 'numpy.ndarray' object has no attribute 'tobytes'

..being issue: sudo pip install numpy --upgrade

Successfully installed numpy
Cleaning up...


Příspěvek byl publikován v rubrice Software a jeho autorem je KillAdmin. Můžete si jeho odkaz uložit mezi své oblíbené záložky nebo ho sdílet s přáteli.