Solvedmoviepy ImageMagick not detected by moviepy while using SubtitlesClip

ubuntu 16.04

  • Install
    apt-get -y install ffmpeg imagemagick

export FFMPEG_BINARY='/usr/bin/ffmpeg'
export IMAGEMAGICK_BINARY='/usr/bin/convert'

from import TextClip,SubtitlesClip

generator = lambda txt: TextClip(txt, font=font, fontsize=40, color=color)

subtitles = SubtitlesClip("",generator)
  • Error
[MoviePy] This command returned an error !--------------------------------------------------------
OSError                Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/moviepy/video/ in __init__(self, txt, filename, size, color, bg_color, fontsize, font, stroke_color, stroke_width, method, kerning, align, interline, tempfilename, temptxt, transparent, remove_temp, print_cmd)
   1219         try:
-> 1220             subprocess_call(cmd, verbose=False )
   1221         except (IOError,OSError) as err:

/usr/local/lib/python3.6/dist-packages/moviepy/ in subprocess_call(cmd, verbose, errorprint)
     48         verbose_print(errorprint, "\n[MoviePy] This command returned an error !")
---> 49         raise IOError(err.decode('utf8'))
     50     else:

OSError: convert: not authorized `@/tmp/tmpatq66tt_.txt' @ error/property.c/InterpretImageProperties/3405.
convert: no images defined `PNG32:/tmp/tmp4uy8drq2.png' @ error/convert.c/ConvertImageCommand/3210.

During handling of the above exception, another exception occurred:

OSError                Traceback (most recent call last)
<ipython-input-3-923a31c238ba> in <module>()
----> 1 subtitles = SubtitlesClip("",generator)

/usr/local/lib/python3.6/dist-packages/moviepy/video/tools/ in __init__(self, subtitles, make_textclip)
     85         self.make_frame = make_frame
---> 86         hasmask = (self.make_textclip('T').mask is not None)
     87         self.mask = (VideoClip(make_mask_frame, ismask=True) if hasmask else None)

<ipython-input-2-31100183c052> in <lambda>(txt)
      1 font="ArialUnicode"
      2 color='white'
----> 3 generator = lambda txt: TextClip(txt, font=font, fontsize=40, color=color)

/usr/local/lib/python3.6/dist-packages/moviepy/video/ in __init__(self, txt, filename, size, color, bg_color, fontsize, font, stroke_color, stroke_width, method, kerning, align, interline, tempfilename, temptxt, transparent, remove_temp, print_cmd)
   1227                     "path to the ImageMagick binary in file, or."
   1228                     "that the path you specified is incorrect" ))
-> 1229             raise IOError(error)
   1231         ImageClip.__init__(self, tempfilename, transparent=transparent)

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

convert: not authorized `@/tmp/tmpatq66tt_.txt' @ error/property.c/InterpretImageProperties/3405.
convert: no images defined `PNG32:/tmp/tmp4uy8drq2.png' @ error/convert.c/ConvertImageCommand/3210.

.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, or.that the path you specified is incorrect

What should I do ?

17 Answers

✔️Accepted Answer

comment out (or remove the line that reads)
<policy domain="path" rights="none" pattern="@*" />

<!-- <policy domain="path" rights="none" pattern="@*" /> -->

Other Answers:

The following code allows me to work with text via MoviePy from a fresh Google Colab instance.

!apt update &> /dev/null
!apt install imagemagick &> /dev/null
!apt install ffmpeg &> /dev/null
!pip3 install moviepy[optional] &> /dev/null
!sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml

Here sed is used to remove the line from the policy.xml file.

Check for the ImageMagick policy file. ImageMagick does not have the proper permission set:

Related Issues:

moviepy ImageMagick not detected by moviepy while using SubtitlesClip
comment out (or remove the line that reads) <policy domain=path rights=none pattern=@* /> <!-- <poli...
moviepy Unable to run the sample code! Getting errors. Plase Help
I just figured this out. imagemagick (ie convert) has a policy.xml file that stops you from accessin...
moviepy AttributeError: module '' has no attribute 'audio_fadein'
For everyone that has the same issue i solved it by modifying the selected init file shown in the pi...
ant motion 模版代码下载下来导入到dva搭建的项目里面,启动时报错(npm start)
开启 JavaScript 就可以了 你好,我下载的Home项目引入到项目工程里面,为了方便,我全部放到了components下面,引入和基本流程没有问题。在家里的win10上面启动没有报错,在win...
react native modal The statusbar turns white when the modal is open (only on certain devices)
statusBarTranslucent property has been added to Modal of RN 0.62 I think this problem has been solve...
lottie ios animation stop after enter background
Seem we have this to pause in background and restart when it reach foreground animationView.backgrou...
react native circular progress No component found for view with name "ARTSurfaceView"
I drag and dropped node_modules/react-native/Libraries/ART/ART.xcodeproj somewhere to my Xcode proje...
react native reanimated V2: Upgrade error InnerNativeModule.installCoreFunctions
was facing same problem react-native: 0.66.0 react-native-reanimated: ^2.3.0-beta.2 ...
uCrop FileUtils NumberFormatException
This is not a complete solution just nothing will happen But I think users should be able to open fi...
react native modal Error property 'left' is not supported by native animated module when using swipe
This is not due to react native limitations Keeping it as simple as the above ...
react native reanimated RN 0.61 Android build fails
I am still facing this This likely has to do with AndroidX or other things of which I am somewhat ig...
react native circular progress Invariant Violation: requireNative Component: "RNSVGPath" was not found in the UIManager
for any future person coming here with this issue that I faced on Android make sure to recompile you...
react native modal Tap outside to close
@Doko-Demo-Doa according to the source code haven't implemented yet there is no close event on backd...
react native modal How to avoid keyboard for bottom half modal
FWIW for those coming from Google Let's say we have a bottom half modal with some TextInput ...
react native reanimated TurboModuleRegistry NativeReanimated error
When loading with 2.0.0-alpha.8 I'm still running into ExceptionsManager.js:179 Invariant Violation:...
manim Failed to build pycairo in ubuntu
I got the same problem during the installation and these commands solved the problem. ...
react native modal How could we add swipe down to close function?
+1 for this feature please Hi I love the way this module:
react native reanimated [Jest] V2 - rc2 Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated'
I opened a PR but if you guys want a temporary fix Use ds300/patch-package and put this on patches/r...
react native reanimated Unable to resolve module ./abs
@jakub-gonet I think in my case watchman was the culprit as even after --reset-cache the issue was s...
barba Update body class?
Got it working with events too: Is it possible to update the body class between transitions? ...
react native reanimated [RN 0.66] iOS build failure: 'boost/operators.hpp' file not found
Try react-native-reanimated: 2.3.0-beta.2 It has fix for search paths Description After updating to ...
react native modal error: bundling failed: Error: Unable to resolve module `./animations`
this command fixed my issue npm start -- --reset-cache I upgraded my react-native-modal from 7.0.2 t...
react native reanimated Android only -> E/ReactNativeJS: undefined is not an object (evaluating '_ReanimatedModule.default.configureProps')
Make sure that you've added new ReanimatedPackage(),in under getPackages Import...
lottie android JSON Reader AssertionError when doInBackground (Android 7, 8)
We are having the same issues (Lottie 2.5.5) - only Android 8 So hope to find a fix soon ...
SkeletonView Wrong skeleton view width on iPhone 8 plus
Ok I've found my problem I was calling showSkeleton in viewDidLoad Moving it to viewDidAppear fixed ...
aseprite Skia build fails on Mojave
For me I have to use @adennen 's solution and also disable webp via skia_use_libwebp=false due to I ...
animated tab bar Major issue when using hidesBottomBarWhenPushed. Please investigate
@sentiasa Hi! It's very easy to solve this issue by using this: Hey guys ...
barba CF7 Wordpess reload
Hi The newest version of wpcf7 needs some code changes: Hi there ...
react native modal modal not begin from bottom
<Modal style={{ margin: 0 }}>....</Modal> can fix your problem I try to make modal that begin from b...
CompactCalendarView Show Event indicators to currently selected day
I've released a new beta version: Let me know if you have any feedback While Adding events to curren...
lottie ios Use image resources in lottie-ios
Hi guys I think the best solution is AnimationImageProvider Lottie has AnimationImageProvider I am s...
barba View afterEnter hook on browser refresh is not triggered
Fixed in @barba/core 2.3.15 Hi there! First of all thanks alot for the great work Using barba since ...
react three fiber Panning / Orbit Controls
@gino8080 you can also import OrbitalControl from drei I'm trying to implement a panning system on s...
svg.js svg rectangle with select resize and draggy
Oh cmon - you enable pointerevents on purpose for all elements with and then you wonder why the rect...
CompactCalendarView Remove First Day as SelectedDayBgColor
Added new xml property and method: Set that to false to not select first day of month Released anew ...
barba Uncaught (in promise) Error: xhr: HTTP code is not 200
I may have had some luck with this issue by passing a larger value to the XHR Timeout The default is...
SkeletonView SkeletonView not working in TableViewCell with custom class
@pennywise94 I ran into this issue too; the giant solid happens because calling showSkeleton() on a ...
FluidTransitions willBlur, didBlur listener not call
Experiencing this again with react-navigation@3.1.0 Perhaps an issue in react-navigation See this th...
react three fiber ✍️ Roadmap for 2.x (suggestions welcome)
@samburgers with the last commits that went in you can do this easily Just keep configs in state and...
glide on Android 10 (Q) , Glide failed to load image from Image from local storage
I have found workaround for above issue on below link fix for above issue add android:requestLegacyE...
glide Glide is incompatible with androidx.*
(with in worked for me Glide Version: 4.7.1 Device/Android Version: All ...
peek convert fails due to resource limits
I think I've found the issue or at least a workaround Hi I'm on Debian with version below ...
ImageSharp WebP Support
I am working on support for webp So far decoding of lossless images is almost done I will continue w...
imagemin /node_modules/jpegtran-bin/vendor/jpegtran ENOENT
Try to rebuild the jpegtran-bin package npm rebuild jpegtran-bin What do I wrong? Node 5.6.0 NPM 3.7...
peek mouse/interaction with recording area on i3
So the way to do it is to make both peek and the window you're trying to capture into floating mode ...
glide The 4.4.0 version is conflict with appcompat-v7:26.1.0
What about just: You'll have to manually include the support-fragment dependency but otherwise it sh...
libvips Install via package managers on Linux?
Amazon Linux 2 seems to be based on RHEL/CentOS 7[1] so I assume you could use Remi's RPM repository...
glide Release Build Failed for Android Studio 3
As #2356 (thanks @SIARAY) shows the problem is Glide referencing$Config.HARD...
glide Certain pictures not loading in Android 4.x
Hi guys From log it seems to be handshake exception Android 4.4 and lower don't support certain prot...
glide Failed to resolve variable '${project.groupId}' after refactoring to androidX
I get this error when migrating to androidx I do not use glide Adding implementation '