我想通过tweepy使用twitter API进行文本挖掘。它安装成功了,但当我运行我的代码时,它显示出
from tweepy import StreamListener ImportError: 没有名为tweepy的模块
我在atom上用Python 3.7.1写的代码。我使用的是Windows 10。
我为此写了以下代码。
from tweepy import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
access_token = "********"
access_token_secret = "*************"
consumer_key = "*************"
consumer_secret = "***************"
def on_data(self, data):
print data
return True
def on_error(self, status):
print status
if __name__ == '__main__':
l = StdOutListener()
auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
stream = Stream(auth, l)
stream.filter(track=['python', 'javascript', 'ruby'])```