facebook / facebook-python-business-sdk

Python SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
1.29k stars 635 forks source link

ImportError: cannot import name 'AsyncJob' #506

Closed mermi closed 6 years ago

mermi commented 6 years ago

Hello,

I need help I wanna use async mode to retrieve data using get_insights but is not working. When I am importing from facebook_business.objects import AsyncJob I am getting:

    from facebook_business.objects import AdAccount, AsyncJob
ModuleNotFoundError: No module named 'facebook_business.objects'

and using adobjects is not helpful as there is no AsyncJob module for that. There is an alternative that I am missing? Thank you looking forward to your help

jingping2015 commented 6 years ago

Please take look example here https://developers.facebook.com/docs/marketing-api/insights/best-practices You should call something like

async_job = campaign.get_insights(params=params, is_async=True)