【发布时间】:2017-11-18 03:07:53
【问题描述】:
我运行了这个简单的 .py:
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 github.com/tweepy/tweepy.git, cd tweepy, python setup.py install
-
谢谢大家。我正在使用 mac osx,即使我安装了 tweepy,我仍然会收到错误消息(我检查过并且我有库和 tweepy 文档)