0

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?

2
  • are you using virtual env? are you sure its in the current environment? Commented Sep 5, 2016 at 18:44
  • Yes I am using VMware, and I just followed the path from the sys.path to check Commented Sep 5, 2016 at 18:49

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

5 Comments

If I rename it the problem is still there :(
maybe you have moviepy dir with __init__.py inside? Current working dir is first on look-up path so any naming conflicts would favor your local files and not interpreter installed packages.
Yes but I just renamed the file to something random and I still have the same problem.
*.pyc file may be left in cwd.
Thank you very much this was indeed the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.