-1

I have run pip3 install moviepy simply to get the software installed. However I am unable to use it.

On a second run of pip I get:

Requirement already satisfied: moviepy in /usr/local/lib/python3.8/dist-packages (1.0.3)

but I have no access to the attributes of moviepy. When I run dir(moviepy) I only get:

['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', 'version']

Have I done something wrong here, or is this to do with anything else I may have installed?

2 Answers2

0

According to the docs you need to import the package like this:

from moviepy.editor import *
iago1460
  • 1,004
  • 8
  • 14
  • [that line](https://github.com/Zulko/moviepy/blob/d213793576d03ff51fd835facf64c94e1a39075a/moviepy/__init__.py#L74) you mentioned is just overriding the behaviour of `import *` and seems it is not working, you can still access your desired class/function if you know the path. e.g. `from moviepy.editor import VideoClip` – iago1460 May 25 '21 at 14:03
0

pip install moviepy installs the latest stable version from PyPI, currently it's 1.0.3. __init__.py for the version is mostly empty, it doesn't import anything interesting. That what you see.

You need to import a subpackage and run dir() on it:

import moviepy.video
print(dir(moviepy.video))
phd
  • 82,685
  • 13
  • 120
  • 165