0
Hello, so, as the title suggests, I’m trying to use graphAPI facebook but without success, my goal is to do data mining for data science, but I’m not having much success, I’m following the documentation and everything, only I keep finding this error:
`AttributeError: partially initialized module 'facebook' has no attribute 'GraphAPI' (most likely due to a circular import)`
The code in question is this:
facebook py.
import os
import dotenv
import facebook
import urllib3
dotenv.load_dotenv()
token = os.environ['USER_ACCESS_TOKEN']
graph = facebook.GraphAPI(access_token=token, version=8.0)
events = graph.request('/search?q=Teste&type=event&limit=10000')
I had my first contact with Graphapi today, only I got there and I can’t find anything on Google, everything points to the same path, I don’t know if it’s something I did wrong in the project as a whole, or I stopped installing some requirement.
And lastly, the access keys are correct(at least as far as I know).
Thanks in advance!
Does your file name happen to be facebook.py? If it is, renaming it should solve the problem, as in this case the Python interpreter would be looking for Graphapi inside your file. Furthermore, try to describe what is the "same path" that was pointed out in your research and you tried as a solution. Knowing what you have tried facilitates in solving the problem.
– Lucas Maraal
That was his name, thank you! As for the "same way" part I wanted to say how the Graphapi part was, but anyway, thank you so much for the help!
– Leite