0

I am running the following code in Python 3 to authenticate in Twitter:

import time
import tweepy

consumer_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
consumer_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
access_token="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
access_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_secret)
api = tweepy.API(auth)

When I run it I get an error:

ImportError: No module named 'requests.compat'; 'requests' is not a package

Any idea on what I am supposed to do to fix it?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Mauro Gentile
  • 1,463
  • 6
  • 26
  • 37

0 Answers0