I want to get info about ad campaign. And I start from this code to get campaign name. and I get this error :
Traceback (most recent call last):
File "C:/Users/win7/PycharmProjects/API_Facebook/dd.py", line 2, in <module>
from facebookads.adobjects.adaccount import AdAccount
File "C:Userswin7AppDataLocalProgramsPythonPython37-32libsite-packagesfacebookadsadobjectsadaccount.py", line 1582
def get_insights(self, fields=None, params=None, async=False, batch=None, pending=False):
^
SyntaxError: invalid syntax
^
What is may be reason? and if you want, can give code examples how can I get more info about campaign?
Click here to view image: code and error
3
Answers
Try updating facebookads:
I’m using facebookads==2.11.4.
More info: https://pypi.org/project/facebookads/
If you’re using Python 3.7, use
async_
, not onlyasync
.They updated and renamed the library, now it’s facebook_ads and
async
argument was renamed tois_async