使用 AWS Lambda 将推送通知发送到 Python 中的 Pusher 应用程序。当我将 Pusher 及其所有依赖项安装到一个目录并压缩到 Lambda 时,我运行了一个简单的测试并收到此错误。
No module named ndg.httpsclient.ssl_peer_verification
这是我尝试运行的代码。
from pusher import Pusher
pusher = Pusher(app_id=u'id', key=u'key', secret=u'secret')
def createPitchZip(context, event):
pusher.trigger('testchannel', 'testevent', {u'some': u'data'})
我看过几篇关于此的文章,但单独安装依赖项似乎没有帮助。
Thanks!
Edit
这是堆栈跟踪
No module named ndg.httpsclient.ssl_peer_verification: ImportError
Traceback (most recent call last):
File "/var/task/lambda.py", line 5, in createPitchZip
pusher = Pusher(app_id='***', key='***', secret='***')
File "/var/task/pusher/pusher.py", line 42, in __init__
from pusher.requests import RequestsBackend
File "/var/task/pusher/requests.py", line 12, in <module>
import urllib3.contrib.pyopenssl
File "/var/task/urllib3/contrib/pyopenssl.py", line 49, in <module>
from ndg.httpsclient.ssl_peer_verification import SUBJ_ALT_NAME_SUPPORT
ImportError: No module named ndg.httpsclient.ssl_peer_verification