是否有 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/