首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Python Crypto安装问题

Python Crypto安装问题
EN

Stack Overflow用户
提问于 2013-06-20 19:30:01
回答 1查看 3.9K关注 0票数 1

我无法在Ubuntu 10.04 LTS上安装最新的Python Crypto模块。我用sudo apt-get remove python-crypto删除了旧的2.0.1加密版本,并继续安装2.6版本。

我下载了最新的Crypto zip,并用sudo python setup.py install运行了安装程序,但我得到:

代码语言:javascript
复制
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只安装了Crypto2.0.1。

我的Python版本是2.6.5。

EN

回答 1

Stack Overflow用户

发布于 2013-06-20 19:47:54

如果您有,即

代码语言:javascript
复制
deb-src http://archive.ubuntu.com/ubuntu quantal main

在你的/etc/apt/soures.list中,你不需要下载zip文件,你可以使用apt-get source来下载源代码,比如;

代码语言:javascript
复制
apt-get install debhelper
apt-get source python-crypto
apt-get build-dep python-crypto

tar xvf python-crypto*debian*tar.gz
cd python-crypto*
debian/rules binary

如果需要,可以在运行前修改debian/rules文件以添加自定义标志

代码语言:javascript
复制
debian/rules binary

构建完成后,可以使用以下命令安装包

代码语言:javascript
复制
dpkg -i *.deb

您的发行版也可能不符合安装最新版本的python-crypto的要求。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17212467

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档