Arif
Arif

Reputation: 379

error: name Twitter not defined on using import twitter

I used import twitter and then tried authenticating using the following command - Twitter(auth=OAuth(access_token, access_token_secret, consumer_key, secret_key))

On running the program I get the error: name Twitter not defined. When I use from twitter import *, it works. Why is it so?

I am asking this because if i use tweepy instead, a simple import tweepyworks. Also, doesn't import twitter work the same as from twitter import *?

Upvotes: 0

Views: 46

Answers (1)

Crapy
Crapy

Reputation: 342

Try twitter.Twitter (auth=OAuth(access_token, access_token_secret, consumer_key, secret_key))

Upvotes: 2

Related Questions