api = twitter.Api() AttributeError: 'module' object has no attribute 'Api

后端 未结 7 1157
借酒劲吻你
借酒劲吻你 2020-12-17 10:14

I have been trying to write a simple mention grabber to get started with the twitter Api. Howsoever I\'ve been experienceing some difficulties when initializing the Api. Run

7条回答
  •  被撕碎了的回忆
    2020-12-17 10:53

    I got the same error because my python file was called twitter.py. It contained:

    import twitter
    api = twitter.Api (consumer_key=...
    

    I renamed the file to twitterdata.py, removed twitter.pyc and then it worked.

提交回复
热议问题