Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MoviePY can't detect ImageMagick binary on Windows

I just got myself a new laptop, wanted to setup MoviePY on that new Windows 64x (Python3.7.0) machine. I triple checked everything but when it comes to text part of my code, it throws that error at me;

OSError: MoviePy Error: creation of None failed because of the following error:

OSError: [WinError 6] The handle is invalid

"ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or that the path you specified is incorrect"

My config_defaults.py file;

import os
FFMPEG_BINARY = os.getenv('FFMPEG_BINARY', 'ffmpeg-imageio')
#IMAGEMAGICK_BINARY = os.getenv('IMAGEMAGICK_BINARY', 'auto-detect')
IMAGEMAGICK_BINARY = "C:\\Program Files\\ImageMagick-7.0.8-Q16\\magick.exe"

The path is correct and both magick.exe and convert.exe exist in that path. I'm also sure ImageMagick is properly installed. When I type convert in cmd, it prints "ImageMagick 7.0.8 Q16 x64" and bunch of other stuff.

What am I missing here?

like image 898
cem akbulut Avatar asked Aug 20 '18 10:08

cem akbulut


People also ask

Do I need Imagemagick with moviepy?

ImageMagick is not strictly required, but needed if you want to use TextClips. It can also be used as a backend for GIFs, though you can also create GIFs with MoviePy without ImageMagick. Once you have installed ImageMagick, MoviePy will try to autodetect the path to its executable.

Why can't I install ImageMagick?

This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or.that the path you specified is incorrect Anyone who used moviepy before can help me? I need to use it to complete my project. Thank you very much!

Why did my moviepy fail to create none?

OSError: MoviePy Error: creation of None failed because of the following error: OSError: [WinError 6] The handle is invalid "ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or that the path you specified is incorrect" My config_defaults.pyfile;

How do I install moviepy with dependencies?

You can install moviepy with all dependencies via: ImageMagick is not strictly required, but needed if you want to use TextClips. It can also be used as a backend for GIFs, though you can also create GIFs with MoviePy without ImageMagick. Once you have installed ImageMagick, MoviePy will try to autodetect the path to its executable.


2 Answers

I had the same error as you but my problem was that I did not properly installed ImageMagick : in the installation wizard you need to check "install legacy utilities".

So I reinstalled it, checked this box and it worked.

Here is a screenshot of the page I am talking about : enter image description here

like image 136
Medsiv Avatar answered Oct 11 '22 18:10

Medsiv


Take the comment from the top line, and instead of auto-detect put the path and put the name convert.

IMAGEMAGICK_BINARY = os.getenv ('IMAGEMAGICK_BINARY', 'C:\Program Files\ImageMagick-7.0.8-Q16\convert.exe')
like image 34
Leonardo Euzébio de Sena Avatar answered Oct 11 '22 19:10

Leonardo Euzébio de Sena