2
votes

Trying to tweet on my Raspberry Pi. Installed both Twython and oauthlib without problem. But can't get past this error:

Traceback (most recent call last): File "tweet_test.py", line 3, in from twython import Twython

File "/usr/lib/python2.7/dist-packages/twython/init.py", line 23, in from .api import Twython

File "/usr/lib/python2.7/dist-packages/twython/api.py", line 14, in from requests_oauthlib import OAuth1, OAuth2

ImportError: No module named requests_oauthlib

Original:

#!/usr/bin/env python
import sys
from twython import Twython

tweetStr = "Tweet text!"

apiKey = 'apiKey'
apiSecret = 'apiSecret'
accessToken = 'A_token'
accessTokenSecret = 'A_token_secret'

api = Twython(apiKey,apiSecret,accessToken,accessTokenSecret)

api.update_status(status=tweetStr)

print "Tweeted: " + tweetStr
1
How did you install Twython but not requests_oauthlib? Did you not use pip?Blender
I thought I did. Here's the sequence I followed: sudo apt-get install python-setuptools, sudo easy_install pip, sudo pip install twythonCurt Poff

1 Answers

-1
votes

Try this it will work

sudo apt-get install -y python3-oauth python3-oauth2client python3-oauthlib python3-requests-oauthlib