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
  • 45,811
  • 27
  • 120
  • 136
Mauro Gentile
  • 1,299
  • 5
  • 23
  • 34

0 Answers0