0

我正在使用适用于 iOS 的 Pythonista,并使用最新版本的StaSh安装了加密包。安装过程中似乎出现了问题,但似乎仍然成功:

Extracting archive file ...
Archive extracted.
Running setup file ...
TypeError('expected string or bytes-like object',)
Failed to run setup.py
Fall back to directory guessing ...
Package installed: cryptography

但是,当我尝试从 cryptography.fertnet 导入 Fertnet 时,我得到了 ModuleNotFoundError。显然我缺少cryptography.hazmat.bindings._padding。有谁知道为什么我没有得到那个模块?

4

1 回答 1

0

密码学模块部分是用 C 语言编写的。这些部分必须编译到共享库中。这些库被命名_constant_time_openssl并且_padding它们应该位于hazmat/bindings.

AFAICT PyPI 仅携带适用于 linux、windows 和 macOS 的编译包,但不携带适用于 IOS 的编译包。所以我的猜测是setup.py失败,因为它无法编译这些库。

于 2020-04-14T19:33:05.867 回答