Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting "Import "moviepy.editor" could not be resolved" error when trying to import moviepy

I am trying to import moviepy. I installed it with pip in my VSCode Terminal:

pip install moviepy

It seems like everything installed correctly, but with the following code:

from moviepy.editor import *

I get this Error:

Traceback (most recent call last):
  File "C:\Users\thoma\OneDrive\Desktop\moviepy\edit.py", line 1, in <module>
    from moviepy.editor import *
ModuleNotFoundError: No module named 'moviepy'

I don't know, what to do now. I am new to programming and stackoverflow, and I am not a native English speaker, so please have leniency.

I already tried installing moviepy manually on GitHub, currently I have it in my program files folder, but I don't know what to do, because I couldn't figure out how to install it in CMD.

like image 788
thomas Avatar asked Oct 27 '25 15:10

thomas


2 Answers

I think it might have been changed in recent versions of moviepy to remove the .editor part. The work around for me was to be specific:

from moviepy import (
    ImageClip, 
    TextClip, 
    CompositeVideoClip, 
    AudioFileClip,
    concatenate_videoclips
)

A compatible version is 1.0.3 which many seem to still use, probably to avoid all the changes in current version 2.x

like image 136
mdkb Avatar answered Oct 29 '25 04:10

mdkb


Do

pip uninstall moviepy

then

pip install moviepy==1.0.3
like image 22
mr PixelPilot Avatar answered Oct 29 '25 05:10

mr PixelPilot