Casey Schneider
Casey Schneider

Reputation: 1

ImportError: No module named 'tweepy.auth'

I'm trying to make a twitter bot using python and twitter but was getting an error. I fixed the first error with this solution but now I have another and at this point I am not sure what to do ( Error with tweepy OAuthHandler)

import tweepy
import sys

from tweepy.auth import OAuthHandler

argfile = str(sys.argv[1])

CONSUMER_KEY = 'aaa'
CONSUMER_SECRET = 'bbb'
ACCESS_KEY = 'ccc'
ACCESS_SECRET = 'ddd'
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)

Upvotes: 0

Views: 2554

Answers (3)

Tushar
Tushar

Reputation: 43

As mentioned by @davedwards in the comments. My file was also saved as Tweepy.py. Renaming it solved the problem.

Upvotes: 1

Fatima-Zahra Chriha
Fatima-Zahra Chriha

Reputation: 21

Same problem. I tried to remove .auth but it didn't work.

My problem was the duplicated file of tweepy if you use git clone https://github.com/tweepy/tweepy.git cd tweepy python setup.py install

make sure to extract tweepy folder that exists inside tweepy. And remove the main tweepy file and try again. It worked for me

Upvotes: 0

python novice
python novice

Reputation: 379

try removing that .auth from the module import portion, and get OAuthHandler directly from tweepy. Also check your tweepy module if it contains auth scrpit

Upvotes: 1

Related Questions