MoviePy Exec() not working, syntax error?

50 views Asked by At

I am trying to have instagrapi automatically upload pictures and videos to instagram and I am having an issue.

I am trying the clip_upload() function and it isn't working. This is the error I get:

    exec("from %s import %s" % (name, name))
  File "<string>", line 1
    from __init__ 2 import __init__ 2

                      ^
SyntaxError: invalid syntax

The carat points at the 2 after init

import pkgutil

import moviepy.video.fx as fx

__all__ = [name for _, name, _ in pkgutil.iter_modules(fx.__path__) if name != "all"]


for name in __all__:
    exec("from %s import %s" % (name, name))

The Exec line is creating the issue when clip_upload() is called:

if media_type == 2 and product_type == 'clips':      #Reel
   client.clip_upload(uploadPath, caption)
0

There are 0 answers