Answers for LLM inference engineers

AttributeError: 'VideoFileClip' object has no attribute 'subclip' (or 'set_duration', 'resize', 'fx', 'volumex'), No module named 'moviepy.editor': every name MoviePy 2 changed and what to write instead

MoviePy 2.0.0 (2024-11-20) removed moviepy.editor and renamed the clip methods. Write from moviepy import VideoFileClip; subclip is subclipped, the set_x methods are with_x (with_duration, with_position, with_audio), resize / crop / rotate are resized / cropped / rotated, volumex is with_volume_scaled, and clip.fx(vfx.fadein, 1) is clip.with_effects([vfx.FadeIn(1)]). Or keep the old names with pip install "moviepy<2". Many tutorials still show 1.x code: paste the error or the code below.

Published 2026-11-26 · MoviePy 1.0.0 to 2.2.1 installed (10 releases) · 39 of the 53 removed clip members gave the same result under their 2.x name · how

# MoviePy 1.x
from moviepy.editor import *
clip = VideoFileClip("in.mp4").subclip(5, 10)
clip = clip.resize(0.5).set_fps(24)
clip = clip.fx(vfx.fadein, 1).volumex(0.8)
txt = TextClip("Hi", fontsize=40, color="white")
txt = txt.set_position("center").set_duration(5)
CompositeVideoClip([clip, txt]).write_videofile("out.mp4")
# MoviePy 2.x
from moviepy import *
clip = VideoFileClip("in.mp4").subclipped(5, 10)
clip = clip.resized(0.5).with_fps(24)
clip = clip.with_effects([vfx.FadeIn(1)]).with_volume_scaled(0.8)
txt = TextClip(text="Hi", font="DejaVuSans.ttf", font_size=40, color="white")
txt = txt.with_position("center").with_duration(5)
CompositeVideoClip([clip, txt]).write_videofile("out.mp4")

Examples:

Runs in your browser on the data in this page (moviepy_names.json); nothing you paste is sent anywhere.

Which clip methods did MoviePy 2 rename?

53 clip members are in 1.0.3 and not in 2.2.1; 51 of them went in 2.0.0 (blit_on in 2.1.2) (make_frame in 2.1.0). "Same result" means the 1.x call in 1.0.3 and the 2.x call in 2.2.1 were run on the same test clip and gave identical duration, size, frame, mask and audio numbers.

MoviePy 1.xMoviePy 2.x
clip.subclip
every clip
clip.subclipped(start, end) (same result in 1.0.3 and 2.2.1)
clip.set_duration
every clip
clip.with_duration(t) (same result in 1.0.3 and 2.2.1)
clip.set_start
every clip
clip.with_start(t) (same result in 1.0.3 and 2.2.1)
clip.set_end
every clip
clip.with_end(t) (same result in 1.0.3 and 2.2.1)
clip.set_position
video clips
clip.with_position(pos) (same result in 1.0.3 and 2.2.1)
clip.set_pos
video clips
clip.with_position(pos) (same result in 1.0.3 and 2.2.1)
clip.set_audio
video clips
clip.with_audio(audioclip) (same result in 1.0.3 and 2.2.1)
clip.set_fps
every clip
clip.with_fps(fps) (same result in 1.0.3 and 2.2.1)
clip.set_opacity
video clips
clip.with_opacity(x) (same result in 1.0.3 and 2.2.1)
clip.set_mask
video clips
clip.with_mask(maskclip) (same result in 1.0.3 and 2.2.1)
clip.resize
video clips
clip.resized(0.5), clip.resized(width=320) or clip.resized((w, h)); as an effect: vfx.Resize(...) (same result in 1.0.3 and 2.2.1)
clip.crop
video clips
clip.cropped(x1=, y1=, x2=, y2=); as an effect: vfx.Crop(...) (same result in 1.0.3 and 2.2.1)
clip.rotate
video clips
clip.rotated(angle, expand=True), or clip.with_effects([vfx.Rotate(angle)]). Plain clip.rotated(90) kept the 64x48 frame where 1.x gave 48x64. (same result in 1.0.3 and 2.2.1)
clip.fx
every clip
clip.with_effects([vfx.MirrorX()]): effects are classes now, passed in a list (1.x: clip.fx(vfx.mirror_x)) (same result in 1.0.3 and 2.2.1)
clip.fl_image
video clips
clip.image_transform(lambda frame: ...) (same result in 1.0.3 and 2.2.1)
clip.fl
every clip
clip.transform(lambda get_frame, t: ...) (same result in 1.0.3 and 2.2.1)
clip.fl_time
every clip
clip.time_transform(lambda t: ...) (same result in 1.0.3 and 2.2.1)
clip.fadein
video clips
clip.with_effects([vfx.FadeIn(duration)]) (same result in 1.0.3 and 2.2.1)
clip.fadeout
video clips
clip.with_effects([vfx.FadeOut(duration)]) (same result in 1.0.3 and 2.2.1)
clip.crossfadein
video clips
clip.with_effects([vfx.CrossFadeIn(duration)]) (same result in 1.0.3 and 2.2.1)
clip.crossfadeout
video clips
clip.with_effects([vfx.CrossFadeOut(duration)]) (same result in 1.0.3 and 2.2.1)
clip.speedx
video clips
clip.with_speed_scaled(factor), or clip.with_effects([vfx.MultiplySpeed(factor)]) (same result in 1.0.3 and 2.2.1)
clip.volumex
every clip
clip.with_volume_scaled(factor), or clip.with_effects([afx.MultiplyVolume(factor)]) (same result in 1.0.3 and 2.2.1)
clip.loop
video clips
clip.with_effects([vfx.Loop(n=2)]) or vfx.Loop(duration=...) (same result in 1.0.3 and 2.2.1)
clip.margin
video clips
clip.with_effects([vfx.Margin(size)]) (same result in 1.0.3 and 2.2.1)
clip.on_color
video clips
clip.with_background_color(size=, color=, pos=, opacity=): the argument col_opacity is now opacity (same result in 1.0.3 and 2.2.1)
clip.invert_colors
video clips
clip.with_effects([vfx.InvertColors()]) (same result in 1.0.3 and 2.2.1)
clip.audio_fadein
every clip
clip.with_effects([afx.AudioFadeIn(duration)]) (same result in 1.0.3 and 2.2.1)
clip.audio_fadeout
every clip
clip.with_effects([afx.AudioFadeOut(duration)]) (same result in 1.0.3 and 2.2.1)
clip.audio_normalize
every clip
clip.with_effects([afx.AudioNormalize()]) (same result in 1.0.3 and 2.2.1)
clip.audio_loop
audio clips
clip.with_effects([afx.AudioLoop(n_loops=2)]) (ran in 2.2.1 (the 1.0.3 call raised here))
clip.afx
video clips
clip.with_effects([afx.MultiplyVolume(0.5)]): audio effects go in the same list (same result in 1.0.3 and 2.2.1)
clip.subfx
video clips
clip.with_effects_on_subclip([vfx.MirrorX()], start, end) (same result in 1.0.3 and 2.2.1)
clip.cutout
every clip
clip.with_section_cut_out(start, end) (same result in 1.0.3 and 2.2.1)
clip.add_mask
video clips
clip.with_mask() with no argument (same result in 1.0.3 and 2.2.1)
clip.set_ismask
every clip
clip.with_is_mask(True) (same result in 1.0.3 and 2.2.1)
clip.set_make_frame
every clip
clip.with_updated_frame_function(f) (same result in 1.0.3 and 2.2.1)
clip.set_memoize
every clip
clip.with_memoize(True) (same result in 1.0.3 and 2.2.1)
clip.ismask
video clips
clip.is_mask (same result in 1.0.3 and 2.2.1)
clip.make_frame
VideoClip, VideoFileClip, ImageClip, ColorClip, CompositeVideoClip, AudioClip, AudioFileClip
clip.frame_function (same result in 1.0.3 and 2.2.1)
clip.ipython_display
every clip
clip.display_in_notebook() (the 2.x name is there; not run)
clip.to_videofile
video clips
clip.write_videofile(...), the name 1.0.3 already has
clip.to_gif
video clips
clip.write_gif(...), the name 1.0.3 already has
clip.to_images_sequence
video clips
clip.write_images_sequence(...), the name 1.0.3 already has
clip.to_audiofile
audio clips
clip.write_audiofile(...), the name 1.0.3 already has
clip.blit_on
video clips
no 2.x name found
clip.coreader
AudioFileClip
no 2.x name found
clip.list
TextClip
gone: 2.x draws text with Pillow, not ImageMagick; pass font="/path/to/font.ttf"
clip.mask_and
video clips
clip.with_effects([vfx.MasksAnd(other)]) (the class is there; not run)
clip.mask_or
video clips
clip.with_effects([vfx.MasksOr(other)]) (the class is there; not run)
clip.memoize_frame
VideoClip, VideoFileClip, ImageClip, ColorClip, CompositeVideoClip, AudioClip, AudioFileClip
clip.memoized_frame (the 2.x name is there; not run)
clip.preview
audio clips
clip.audiopreview() (the 2.x name is there; not run)
clip.search
TextClip
gone: 2.x draws text with Pillow, not ImageMagick; pass font="/path/to/font.ttf"

What replaces from moviepy.editor import ...?

moviepy.editor is gone in every 2.x release; its names are at the top of the package. What from moviepy.editor import * gave in 1.0.3, and where each is in 2.2.1:

In moviepy.editor (1.0.3)MoviePy 2.x
AudioClipfrom moviepy import AudioClip
AudioFileClipfrom moviepy import AudioFileClip
ColorClipfrom moviepy import ColorClip
CompositeAudioClipfrom moviepy import CompositeAudioClip
CompositeVideoClipfrom moviepy import CompositeVideoClip
ImageClipfrom moviepy import ImageClip
ImageSequenceClipfrom moviepy import ImageSequenceClip
TextClipfrom moviepy import TextClip
VideoClipfrom moviepy import VideoClip
VideoFileClipfrom moviepy import VideoFileClip
afxfrom moviepy import afx
clips_arrayfrom moviepy import clips_array
concatenatefrom moviepy import concatenate_videoclips (same result in 1.0.3 and 2.2.1)
concatenate_audioclipsfrom moviepy import concatenate_audioclips
concatenate_videoclipsfrom moviepy import concatenate_videoclips
cvsecsfrom moviepy import convert_to_seconds (same result in 1.0.3 and 2.2.1)
download_webfilenot in 2.x
ffmpeg_toolsfrom moviepy import ffmpeg_tools
ipython_displayfrom moviepy import display_in_notebook, or clip.display_in_notebook()
previewclip.preview() (a method of the clip)
showclip.show() (a method of the clip)
transfxfrom moviepy import vfx: transfx.crossfadein is vfx.CrossFadeIn, transfx.slide_in is vfx.SlideIn (also CrossFadeOut, SlideOut) (same result in 1.0.3 and 2.2.1)
vfxfrom moviepy import vfx
videotoolsfrom moviepy import videotools

Modules that 1.0.3 has and 2.2.1 does not (54; the 36 one-function effect modules such as moviepy.video.fx.resize are in the next table):

Module (1.x)MoviePy 2.x
moviepy.audio.fx.allfrom moviepy import afx: the effects are classes in moviepy.audio.fx (afx.MultiplyVolume, afx.AudioFadeIn, ...)
moviepy.audio.io.previewgone; no 2.x module of that name
moviepy.compatgone; no 2.x module of that name
moviepy.config_defaultsgone; no 2.x module of that name
moviepy.editorfrom moviepy import VideoFileClip (every class is at the top now; from moviepy import * also works). 1.x: from moviepy.editor import *
moviepy.utilsclose_all_clips is in moviepy.tools
moviepy.video.compositing.concatenatefrom moviepy import concatenate_videoclips (it now lives in moviepy.video.compositing.CompositeVideoClip)
moviepy.video.compositing.on_colorgone; no 2.x module of that name
moviepy.video.compositing.positioninggone; no 2.x module of that name
moviepy.video.compositing.transitionsfrom moviepy import vfx: vfx.CrossFadeIn, vfx.CrossFadeOut, vfx.SlideIn, vfx.SlideOut
moviepy.video.fx.allfrom moviepy import vfx: the effects are classes in moviepy.video.fx (vfx.Resize, vfx.FadeIn, ...)
moviepy.video.io.bindingsgone; no 2.x module of that name
moviepy.video.io.downloadergone; no 2.x module of that name
moviepy.video.io.html_toolsmoviepy.video.io.display_in_notebook
moviepy.video.io.previewmoviepy.video.io.ffplay_previewer
moviepy.video.io.slidersgone; no 2.x module of that name
moviepy.video.tools.segmentinggone; no 2.x module of that name
moviepy.video.tools.trackinggone; no 2.x module of that name

Which effect class replaces each vfx / afx function?

Effects are classes in 2.x, applied with clip.with_effects([...]). The module moved with the name: moviepy.video.fx.resize is moviepy.video.fx.Resize.

1.x function2.x class
vfx.accel_decelvfx.AccelDecel (the 2.x name is there; not run)
vfx.blackwhitevfx.BlackAndWhite (same result in 1.0.3 and 2.2.1)
vfx.blinkvfx.Blink (ran in 2.2.1 (the 1.0.3 call raised here))
vfx.colorxvfx.MultiplyColor (same result in 1.0.3 and 2.2.1)
vfx.cropvfx.Crop (same result in 1.0.3 and 2.2.1)
vfx.even_sizevfx.EvenSize (same result in 1.0.3 and 2.2.1)
vfx.fadeinvfx.FadeIn (same result in 1.0.3 and 2.2.1)
vfx.fadeoutvfx.FadeOut (same result in 1.0.3 and 2.2.1)
vfx.freezevfx.Freeze (same result in 1.0.3 and 2.2.1)
vfx.freeze_regionvfx.FreezeRegion (the 2.x name is there; not run)
vfx.gamma_corrvfx.GammaCorrection (same result in 1.0.3 and 2.2.1)
vfx.headblurvfx.HeadBlur (the 2.x name is there; not run)
vfx.invert_colorsvfx.InvertColors (same result in 1.0.3 and 2.2.1)
vfx.loopvfx.Loop (same result in 1.0.3 and 2.2.1)
vfx.lum_contrastvfx.LumContrast (same result in 1.0.3 and 2.2.1)
vfx.make_loopablevfx.MakeLoopable (same result in 1.0.3 and 2.2.1)
vfx.marginvfx.Margin (same result in 1.0.3 and 2.2.1)
vfx.mask_andvfx.MasksAnd (the 2.x name is there; not run)
vfx.mask_colorvfx.MaskColor (same result in 1.0.3 and 2.2.1)
vfx.mask_orvfx.MasksOr (the 2.x name is there; not run)
vfx.mirror_xvfx.MirrorX (same result in 1.0.3 and 2.2.1)
vfx.mirror_yvfx.MirrorY (same result in 1.0.3 and 2.2.1)
vfx.paintingvfx.Painting (the 2.x name is there; not run)
vfx.resizevfx.Resize (same result in 1.0.3 and 2.2.1)
vfx.rotatevfx.Rotate (same result in 1.0.3 and 2.2.1)
vfx.scrollvfx.Scroll (the 2.x name is there; not run)
vfx.speedxvfx.MultiplySpeed (same result in 1.0.3 and 2.2.1)
vfx.supersamplevfx.SuperSample (the 2.x name is there; not run)
vfx.time_mirrorvfx.TimeMirror (ran in both; the result was not identical)
vfx.time_symmetrizevfx.TimeSymmetrize (same result in 1.0.3 and 2.2.1)
afx.audio_fadeinafx.AudioFadeIn (same result in 1.0.3 and 2.2.1)
afx.audio_fadeoutafx.AudioFadeOut (same result in 1.0.3 and 2.2.1)
afx.audio_left_rightafx.MultiplyStereoVolume (ran in 2.2.1 (the 1.0.3 call raised here))
afx.audio_loopafx.AudioLoop (ran in 2.2.1 (the 1.0.3 call raised here))
afx.audio_normalizeafx.AudioNormalize (same result in 1.0.3 and 2.2.1)
afx.volumexafx.MultiplyVolume (same result in 1.0.3 and 2.2.1)

Which arguments did MoviePy 2 rename or drop?

Read from the signatures of 1.0.3 and 2.2.1. In 2.2.1, TextClip(fontsize=20) raises "TypeError: got an unexpected keyword argument 'fontsize'" and write_videofile(verbose=False) raises "TypeError: got an unexpected keyword argument 'verbose'".

Call1.x argument → 2.x
TextClip()txt → text=; fontsize → font_size=; kerning gone; align gone (2.x has text_align=, horizontal_align=, vertical_align=); tempfilename gone; temptxt gone; remove_temp gone; print_cmd gone
ColorClip()ismask → is_mask=; col → color=
VideoClip()make_frame → frame_function= (from 2.1.0); ismask → is_mask=
AudioClip()make_frame → frame_function= (from 2.1.0)
ImageClip()ismask → is_mask=
CompositeVideoClip()ismask → is_mask=
ImageSequenceClip()ismask → is_mask=
VideoFileClip()verbose gone
concatenate_videoclips()ismask → is_mask=
clips_array()cols_widths gone (2.x has cols_heights=)
clip.write_videofile()rewrite_audio gone; verbose drop it; logger=None silences the progress bar
clip.write_gif()program gone; opt gone; fuzz gone; verbose drop it; logger=None silences the progress bar; dispose gone; colors gone; tempfiles gone
clip.write_images_sequence()nameformat → name_format=; verbose gone; withmask → with_mask=
clip.save_frame()withmask → with_mask=
audioclip.write_audiofile()verbose drop it; logger=None silences the progress bar
SubtitlesClip.in_subclip()t_start → start_time=; t_end → end_time=

How was this measured?

MoviePy 1.0.0, 1.0.1, 1.0.2, 1.0.3, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1 were each installed from PyPI in their own environment (Python 3.11.18), and a probe listed every module file, the names of each importable module, and the members and parameters of every class, after import moviepy.editor where it exists (that import is what attaches resize, fadein and the other effect methods to the clips in 1.x). Members set in __init__ were read from real objects: a ColorClip, ImageClip, AudioClip, CompositeVideoClip, and a VideoFileClip and AudioFileClip of a one-second file written with the bundled ffmpeg.

Each rename was then run: the 1.x spelling in 1.0.3 and the 2.x spelling in 2.2.1 on the same two-second 64x48 clip (a moving gradient with a 440 Hz tone), comparing duration, size, fps, the frame at t=0.5, the mask frame and the loudest audio sample. Rows that did not come out identical say so. 1.x TextClip needs ImageMagick and could not be built here, so TextClip was run in 2.x only. 2.0.0.dev1 and dev2 (2020) were not installed.

Questions

How do I fix "'VideoFileClip' object has no attribute 'subclip'"?

MoviePy 2.0.0 (2024-11-20) renamed it: write clip.subclipped(start, end). The other methods changed the same way: set_duration, set_start, set_position and the rest are with_duration, with_start, with_position; resize, crop and rotate are resized, cropped and rotated. Run on a test clip, subclip(0.5, 1.5) in 1.0.3 and subclipped(0.5, 1.5) in 2.2.1 gave the same frames. To keep the old names: pip install "moviepy<2".

How do I fix "No module named 'moviepy.editor'"?

MoviePy 2.0.0 removed moviepy.editor. Write from moviepy import VideoFileClip, AudioFileClip, concatenate_videoclips (or from moviepy import *). Code written for 1.x then needs the renamed methods too, or pip install "moviepy==1.0.3".

How do I fix "'VideoFileClip' object has no attribute 'resize'" (or 'fx', 'fadein', 'volumex')?

In 1.x these were effect functions attached to the clip. In 2.x: clip.resized(0.5), clip.cropped(...), clip.rotated(angle, expand=True), clip.with_volume_scaled(0.5), clip.with_speed_scaled(2); and for every effect, clip.with_effects([vfx.FadeIn(1), vfx.MirrorX()]) with the effect classes from moviepy import vfx, afx. clip.fx(vfx.mirror_x) becomes clip.with_effects([vfx.MirrorX()]).

How do I fix "TextClip got an unexpected keyword argument 'fontsize'" or "multiple values for argument 'font'"?

In 2.x the first parameter of TextClip is font, a path to a font file, and the others were renamed: TextClip(text="hi", font="/path/DejaVuSans.ttf", font_size=20, color="white") ran in 2.2.1. txt is text and fontsize is font_size. TextClip("hi", font=...) raises "multiple values for argument 'font'" because "hi" lands on font.

How do I fix "write_videofile() got an unexpected keyword argument 'verbose'"?

2.x dropped verbose (and rewrite_audio) from write_videofile, and verbose from write_audiofile and write_gif. Remove the argument; logger=None silences the progress bar.

How do I fix "'ImageDraw' object has no attribute '_multiline_spacing'" in TextClip?

That is MoviePy 2.2.0 with Pillow 11.3.0: building a TextClip raised it here. 2.2.1, installed with the same Pillow, builds the same clip. pip install -U moviepy.

Why does moviepy.__version__ show the wrong version?

The attribute was not updated in three releases: 2.1.2 reports 2.1.1, and 2.2.0 and 2.2.1 report 2.1.2. Use pip show moviepy, or importlib.metadata.version("moviepy").

Sources

The same data as JSON: moviepy_names.json, licensed CC BY 4.0.

Related: "module 'cv2' has no attribute 'CascadeClassifier'" · "module 'PIL.Image' has no attribute 'ANTIALIAS'" · "module 'numpy' has no attribute 'float_'".