我无法在 Ubuntu 10.04 LTS 上安装最新的 Python Crypto 模块。我删除了旧的 2.0.1 Crypto 版本sudo apt-get remove python-crypto
并继续安装 2.6 版本。
我下载了最新的 Crypto zip 并运行安装程序sudo python setup.py install
,但我得到:
running install
running build
running build_py
running build_ext
running build_configure
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Cipher._AESNI' extension
gcc -std=gnu99 -fno-strict-aliasing -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -DHAVE_CONFIG_H -fPIC -Isrc/ -I/usr/include/python2.6 -c src/AESNI.c -o build/temp.linux-i686-2.6/src/AESNI.o -maes
In file included from /usr/lib/gcc/i486-linux-gnu/4.4.3/include/wmmintrin.h:31,
from src/AESNI.c:26:
/usr/lib/gcc/i486-linux-gnu/4.4.3/include/emmintrin.h: In function \u2018aes128_keyexpand\u2019:
/usr/lib/gcc/i486-linux-gnu/4.4.3/include/emmintrin.h:1380: error: the last argument must be an 8-bit immediate
error: command 'gcc' failed with exit status 1
我安装了python-dev
,但是没有效果。
apt-get install python-crypto
只需安装 Crypto 2.0.1。
我的 Python 版本是 2.6.5。