Quantcast
Channel: api = twitter.Api() AttributeError: 'module' object has no attribute 'Api - Stack Overflow
Viewing all articles
Browse latest Browse all 8

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

$
0
0

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.Running python2 on archlinux I installed twitter via easy_install, built it from source and installed it via pip. None of this seems to be working.

zergling :: ~/dev/kritter » python2Python 2.7.2 (default, Jan 31 2012, 13:26:35) [GCC 4.6.2 20120120 (prerelease)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import twitter>>> api = twitter.Api()Traceback (most recent call last):  File "<stdin>", line 1, in <module>AttributeError: 'module' object has no attribute 'Api'

Howsoever the pydoc for twitter is there. I have no clue what I'm doing wrong. I hope you can help

UPDATE:I tried using twitter.api() instead of twitter.Api() and got the following error: Traceback (most recent call last): File "main.py", line 8, in api = twitter.api() TypeError: 'module' object is not callable

Additional Informations:

>>> print dir(twitter)['NoAuth', 'OAuth', 'Twitter', 'TwitterError', 'TwitterHTTPError', 'TwitterResponse',  'TwitterStream', 'UserPassAuth', '__all__', '__builtins__', '__doc__', '__file__',  '__name__', '__package__', '__path__', 'api', 'auth', 'oauth', 'read_token_file', 'stream', 'twitter_globals', 'write_token_file']>>> print twitter.__path__['/usr/lib/python2.7/site-packages/twitter-1.7.2-py2.7.egg/twitter']

Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>