使用AWS Lambda將推送通知發送到Python中的Pusher應用程序。當我將Pusher及其所有依賴項安裝到一個目錄並將其壓縮到Lambda時,我會運行一個簡單的測試並獲取此錯誤。Python推杆AWS 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'})
我已經看過幾篇文章,但單獨安裝依賴關係似乎沒有幫助。
謝謝!
編輯
這裏是堆棧跟蹤
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
Yah我看到他作爲AWS文檔vs'pip install -t目錄推送器'中的其他選項,我會給它一個回去找回你。感謝您的建議。 – jamesmpw
剛剛通過你的過程,(這比pip安裝順便多了),我仍然得到相同的錯誤。我添加了追溯到我原來的帖子,以獲得更多的澄清。請求包正在進行中。 – jamesmpw