from cryptography.hazmat.bindings._constant_time import lib ImportError: No module named _constant_time

怎甘沉沦 提交于 2019-12-13 03:46:27

问题


I am basically deploying a flask app in app engine that uses pywebpush(https://github.com/web-push-libs/pywebpush). I followed the following tutorial to deploy(https://cloud.google.com/appengine/docs/standard/python/getting-started/python-standard-env) But i am constantly getting the error in app engine while it works fine in local system. The Error is: "from cryptography.hazmat.bindings._constant_time import lib ImportError: No module named _constant_time". Can Someone help me to over come this?


回答1:


That library is not included in App Engine, so, you have to include it.

Follow the commands in Copying a third-party library, in your case, with pywebpush, to do so.

EDIT: pywebpush depends on a library with C extensions, which can not be used in Standard. To be able to use pywebpush, you will have to move to App Engine Flexible. I have followed this example, adding the pywebpush dependency and calling a function from it, and it worked both in local and deployed.



来源:https://stackoverflow.com/questions/49719643/from-cryptography-hazmat-bindings-constant-time-import-lib-importerror-no-modu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!