-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