python - 在 Alpine 中用于 Python3 的 PyCrypto?

标签 python python-3.x pycrypto alpine-linux

是否有 Alpine 包允许我为 Python 3 安装 PyCrypto?

pip3 install pycrypto 遇到问题后,我偶然发现了这篇解释 how to install numpy in Alpine 的帖子使用 apk 添加 py-numpy@testing。也可以使用 apk add py-crypto 为 Python2.7 安装 PyCrypto。但是,我似乎无法弄清楚如何为 Python3 调用 pycrypto,或者即使这个包存在。

作为替代解决方案,我尝试使用 apk add gcc 安装 C 编译器 gcc,以便 pip3 install pycrypto 中的设置工具可以编译。但是,当我已经使用 gcc 运行该命令时,它会抛出一个 fatal error :

...
running build_ext
running build_configure
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/pip-build-2TivSm/pycrypto':
configure: error: C compiler cannot create executables
...

难道没有办法在 Alpine 中编译 Python3 模块吗?

最佳答案

这对我有用:

apk add gcc g++ make libffi-dev openssl-dev

然后进行 pip 安装。

关于python - 在 Alpine 中用于 Python3 的 PyCrypto?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35397295/

相关文章:

python - 带有 python 2.7 的 Windows 上的 Readline 功能

python - python中两个列表的比较

Python:动态实例化

python - 压缩后的加密文件比源文件大

python - 在类初始化时发出 HTTP 请求

python - Python 中父类方法生成其子类实例的设计是否错误?

python - 在 Tkinter、Python 3 中设置窗口尺寸

ide - 具有代码完成功能的 python IDE,包括参数对象类型推断

python - PyCrypto 在 OSX Mavericks 中不工作

python - Pycrypto - 使用 Crypto.Random 生成 key 和初始化向量