This article explains how to fix the ‘ImageMagick is not installed’ error in moviepy when ImageMagick is actually installed.
When I tried to test some sample code from moviepy, I got an error.
This error can be due to the fact that ImageMagick is not installed
Hmm, but both ffmpeg and imagemagick are installed.
sudo apt update; sudo apt install imagemagick
Zulko/moviepy: Video editing with Python
On Windows, editing a configuration file like the following seems necessary, but I’m on Ubuntu (not even WSL).
Once you have installed it, ImageMagick will be automatically detected by MoviePy, except on Windows !. Windows user, before installing MoviePy by hand, go into the moviepy/> config_defaults.py file and provide the path to the ImageMagick binary called convert. It should look like this
IMAGEMAGICK_BINARY = “C:\Program Files\ImageMagick_VERSION\convert.exe”
Looking at the issues, I found a likely solution.
I just figured this out.. imagemagick (ie, convert) has a policy.xml file that stops you from accessing any resource that starts with ’@’.
Unable to run the sample code! Getting errors. Plase Help · Issue #401 · Zulko/moviepy
Run the following command:
yuis@yuis:~/share04/_tmp/tmp$ identify -list policy
Path: /etc/ImageMagick-6/policy.xml
Policy: Resource
name: disk
value: 1GiB
Policy: Resource
name: map
value: 512MiB
The configuration file appears to be at /etc/ImageMagick-6/policy.xml, so let’s open and edit it.
There should be a line <policy domain=“path” rights=“none” pattern=”@*” />, so comment it out.
Try again:
# Import everything needed to edit video clips
from moviepy.editor import *
# Load myHolidays.mp4 and select the subclip 00:00:50 - 00:00:60
clip = VideoFileClip("noranekoMV.mp4").subclip(50,60)
# Reduce the audio volume (volume x 0.8)
clip = clip.volumex(0.8)
# Generate a text clip. You can customize the font, color, etc.
txt_clip = TextClip("My Holidays 2013",fontsize=70,color='white')