Slack API - rtm_connect 错误

Luc*_*cas 0 python python-2.7 pythonanywhere slack-api

尝试使用 Slack API(实时消息传递)时,我收到了似乎是认证错误的信息。

任何想法为什么会发生这种情况?很想得到一些反馈,为我指明正确的方向。我使用的是 python 2.7,代码托管在 pythonanywhere 的付费帐户中。

import os
from slackclient import SlackClient
verif_token = os.environ.get("MYTOKEN")
slack_client = SlackClient(verif_token)
slack_client.rtm_connect(with_team_state=False)


Traceback (most recent call last):
File "/home/xyz/.local/lib/python2.7/site-packages/slackclient/client.py", line 52, in rtm_connect
self.server.rtm_connect(use_rtm_start=with_team_state, **kwargs)
File "/home/xyz/.local/lib/python2.7/site-packages/slackclient/server.py", line 147, in rtm_connect
self.connect_slack_websocket(self.ws_url)
File "/home/xyz/.local/lib/python2.7/site-packages/slackclient/server.py", line 186, in connect_slack_websocket
raise SlackConnectionError(message=str(e))
SlackConnectionError: _ssl.c:335: No root certificates specified for verification of other-side certificates.
Run Code Online (Sandbox Code Playgroud)

Luc*_*cas 5

如果看起来这是 slack 使用的 websocket 库的一个已知问题:https : //github.com/slackapi/python-slackclient/issues/334

将 websocket-client 库降级到 0.47.0 解决了这个问题。