python - Sage 没有名为 Crypto 的模块导入错误

标签 python sage

我在 Ubuntu 机器上运行 Sage 的笔记本,并且使用模块 crypto 来使用 AES。我的代码是from Crypto.Cipher import AES。有很多帖子都出现错误 ImportError: No module named Crypto 但显然它们都不适合我,因为我有一个 python anaconda 安装和一个用于 Sage 的 python 安装。怎么解决呢?

最佳答案

使用 Sage 的 pip 安装 pycrypto 模块, 通过在终端中运行以下命令:

$ sage --pip install pycrypto

然后启动 Sage 并使用 Crypto 模块:

$ sage -q
sage: from Crypto.Cipher import AES
sage:

关于python - Sage 没有名为 Crypto 的模块导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40787908/

相关文章:

python - SQLAlchemy - 在查询中使用混合属性

python - WEKA 中的交叉验证和 SMOTE

python - 如何使输入栏保持在屏幕底部

python - python 简单函数赋值错误

python - 广播两个不同形状的数组(Numpy-Python)

r - 我如何从 R 中调用 Sage?

python - 为什么我在 Sage 中遇到 "large"矩阵的问题?

python - 如何从 python/Sage 中的多项式中提取变量

python - plot() 出现意外行为的原因是什么

python - 使用 Z3 求解线性方程