Thijs
Thijs

Reputation: 785

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 "moviepy.py", line 2, in
from moviepy.editor import *
File "/home/debian/Videos/moviepy.py", 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__.py __init__.pyc and editor.py so what am I doing wrong?

Upvotes: 0

Views: 760

Answers (1)

Łukasz Rogalski
Łukasz Rogalski

Reputation: 23203

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

Upvotes: 2

Related Questions