I try to connect to facebook api with Python. I am using anaconda and also I get the following error:
I use anaconda
import json
import facebook
def main():
token = "--token-key--"
graph = facebook.GraphAPI(token)
profile = graph.get_object('me',fields='first_name')
print(json.dumps(profile, indent=4))
Error:
File "C:/Users/rabia.nural/Desktop/untitled6.py", line 9, in import facebook File "C:\Users\rabia.nural\AppData\Local\Continuum\anaconda3\lib\site-packages\facebook.py", line 222 except urllib2.HTTPError, e: ^ SyntaxError: invalid syntax