twython - No module named twython error

梦想与她 提交于 2019-12-08 07:07:27

问题


I installed tywthon on my raspberry pi using the following command:

sudo pip install twython

There were no errors during the install. When I run my python file it comes up with:

ImportError: No module named twython

Code is as follows:

import sys
import datetime
from twython import Twython

#Twitter keys

CONSUMER_KEY="xxx"
CONSUMER_SECRET ="xxx"
ACCESS_KEY = "xxx"
ACCESS_SECRET ="xxx"

api = Twython(CONSUMER_KEY,CONSUMER_SECRET,ACCESS_KEY,ACCESS_SECRET)

dt=datetime.datetime.now()
mon=4-dt.month
day=18-dt.day
hr=23-dt.hour
mn=60-dt.minute
sec=60-dt.second

pythonTest("Hi, I'm using my raspberry pi and python to tweet status     updates.")
python_string=("Time until Ben's birthday: "+str(mon)+" Months, "+str(day)+" days, "+str(hr)+" hours, "+str(mn)+" minutes")

api.update_status(status=python_Test)   

I am using python 3. Not sure if that matters or not?

来源:https://stackoverflow.com/questions/28543040/twython-no-module-named-twython-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!