Thijs Thijs - 1 year ago 327
Python Question

how to fix ImportError python

I have a file beginning with

from moviepy.editor import *
when I run this file I get the error:

Traceback (most recent call last):
File "", line 2, in

from moviepy.editor import *

File "/home/debian/Videos/", line 2, in

from moviepy.editor import *

ImportError: No module named editor

the strange thing is I am 100% sure moviepy is installed.
I checked sys.path and in one of the paths is a folder called moviepy with multiple files inside including __init__.pyc and
so what am I doing wrong?

Answer Source

Your filename shadows installed package. Rename your main file and everything should work fine (if moviepy is installed in used interpreter).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download