使用 Tweepy 的不安全平台警告
InsecurePlatformWarning Using Tweepy
我在 mac book air 上使用 python 2.7.7。我从官方 Tweepy 文档中复制了代码 - http://docs.tweepy.org/en/latest/streaming_how_to.html?highlight=stream。
import tweepy
consumer_key = "***"
consumer_secret = "***"
access_token = "***"
access_token_secret = "***"
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
class MyStreamListener(tweepy.StreamListener):
def on_status(self, status):
print(status.text)
myStreamListener = MyStreamListener()
myStream = tweepy.Stream(auth = api.auth, listener=MyStreamListener())
myStream.filter(track=['@soroushg_'])
但是每当我运行这段代码时,它会说
InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail.
如果有人知道为什么我很想知道。提前致谢。
是pip的问题,我必须更新pip!
我在 mac book air 上使用 python 2.7.7。我从官方 Tweepy 文档中复制了代码 - http://docs.tweepy.org/en/latest/streaming_how_to.html?highlight=stream。
import tweepy
consumer_key = "***"
consumer_secret = "***"
access_token = "***"
access_token_secret = "***"
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
class MyStreamListener(tweepy.StreamListener):
def on_status(self, status):
print(status.text)
myStreamListener = MyStreamListener()
myStream = tweepy.Stream(auth = api.auth, listener=MyStreamListener())
myStream.filter(track=['@soroushg_'])
但是每当我运行这段代码时,它会说
InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail.
如果有人知道为什么我很想知道。提前致谢。
是pip的问题,我必须更新pip!