-3
我跑这个简单的.py:Eror导入tweepy?
from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
ckey = ''
csecret = ''
atoken = ''
asecret = ''
class Listener(StreanListener):
def on_data(self, data):
print data
return True
def on_error(self, status):
print status
OAuthHandler(ckey, csecret)
auth.set_access_token(atoken, asecret)
twitterStream = Strean(auth, Listener())
twitterStream.filter(track=["tour de france"])
和我得到这个错误:
File "twe.py", line 1, in <module>
from tweepy import Stream
File "/Users/Raz-mac/Documents/tweepy.py", line 1
git clone https://github.com/tweepy/tweepy.git
我猜测它涉及到进口tweepy? 我该如何解决这个问题?
你安装了吗? ** git clone https://github.com/tweepy/tweepy.git, cd tweepy, python setup.py install ** – Stack
谢谢你们。我使用的是mac osx,即使安装了tweepy,我仍然收到错误信息(我检查过了,我有库和tweepy文档) – rm21