0

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)
Nico
  • 19
  • 3
  • Indeed, the syntax `from __init__ 2 import __init__ 2` is invalid. `__init__ 2` is not a valid name as it contains a space. I don't know why `name`'s value is `'__init__ 2'`, but that's the issue. Why do you think it has to be that value? – Random Davis May 03 '23 at 17:48
  • 1
    Show us your code. We can't tell anything from this. – Tim Roberts May 03 '23 at 17:49
  • I can paste my entire code into the post if that'll help. – Nico May 03 '23 at 20:18

0 Answers0