来自cryptography.hazmat.bindings._constant_time import lib ImportError:没有名为_constant_time

时间:2018-04-08 15:40:52

标签: python google-app-engine python-cryptography

我基本上在使用pywebpush(https://github.com/web-push-libs/pywebpush)的app引擎中部署了一个烧瓶应用程序。我按照以下教程进行部署(https://cloud.google.com/appengine/docs/standard/python/getting-started/python-standard-env)但我在应用程序引擎中不断收到错误,而它在本地系统中运行正常。 错误是:“来自cryptography.hazmat.bindings._constant_time import lib ImportError:没有名为_constant_time的模块“。 有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

App Engine中的库是not included,因此,您必须包含它。

按照Copying a third-party library中的命令(在您的情况下,使用pywebpush)进行操作。

编辑:pywebpush取决于具有C扩展名的库can not be used in Standard。为了能够使用pywebpush,您必须转到App Engine Flexible。我跟着this example,添加了pywebpush依赖项并从中调用了一个函数,它在本地和已部署都有效。