0

嗨,我正在尝试从这里安装 pycrypto-2.3

我下载并运行以下命令

cd pycrypto-2.3/

python setup.py install

我收到以下错误,

running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/Crypto
copying lib/Crypto/pct_warnings.py -> build/lib.linux-x86_64-2.7/Crypto
copying lib/Crypto/__init__.py -> build/lib.linux-x86_64-2.7/Crypto
creating build/lib.linux-x86_64-2.7/Crypto/Hash
copying lib/Crypto/Hash/SHA.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
copying lib/Crypto/Hash/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
copying lib/Crypto/Hash/MD5.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
copying lib/Crypto/Hash/RIPEMD.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
copying lib/Crypto/Hash/HMAC.py -> build/lib.linux-x86_64-2.7/Crypto/Hash
creating build/lib.linux-x86_64-2.7/Crypto/Cipher
copying lib/Crypto/Cipher/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Cipher
creating build/lib.linux-x86_64-2.7/Crypto/Util
copying lib/Crypto/Util/_number_new.py -> build/lib.linux-x86_64-2.7/Crypto/Util
copying lib/Crypto/Util/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Util
copying lib/Crypto/Util/winrandom.py -> build/lib.linux-x86_64-2.7/Crypto/Util
copying lib/Crypto/Util/python_compat.py -> build/lib.linux-x86_64-2.7/Crypto/Util
copying lib/Crypto/Util/RFC1751.py -> build/lib.linux-x86_64-2.7/Crypto/Util
copying lib/Crypto/Util/asn1.py -> build/lib.linux-x86_64-2.7/Crypto/Util
copying lib/Crypto/Util/randpool.py -> build/lib.linux-x86_64-2.7/Crypto/Util
copying lib/Crypto/Util/Counter.py -> build/lib.linux-x86_64-2.7/Crypto/Util
copying lib/Crypto/Util/number.py -> build/lib.linux-x86_64-2.7/Crypto/Util
creating build/lib.linux-x86_64-2.7/Crypto/Random
copying lib/Crypto/Random/_UserFriendlyRNG.py -> build/lib.linux-x86_64-2.7/Crypto/Random
copying lib/Crypto/Random/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Random
copying lib/Crypto/Random/random.py -> build/lib.linux-x86_64-2.7/Crypto/Random
creating build/lib.linux-x86_64-2.7/Crypto/Random/Fortuna
copying lib/Crypto/Random/Fortuna/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Random/Fortuna
copying lib/Crypto/Random/Fortuna/FortunaAccumulator.py -> build/lib.linux-x86_64-2.7/Crypto/Random/Fortuna
copying lib/Crypto/Random/Fortuna/FortunaGenerator.py -> build/lib.linux-x86_64-2.7/Crypto/Random/Fortuna
copying lib/Crypto/Random/Fortuna/SHAd256.py -> build/lib.linux-x86_64-2.7/Crypto/Random/Fortuna
creating build/lib.linux-x86_64-2.7/Crypto/Random/OSRNG
copying lib/Crypto/Random/OSRNG/rng_base.py -> build/lib.linux-x86_64-2.7/Crypto/Random/OSRNG
copying lib/Crypto/Random/OSRNG/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Random/OSRNG
copying lib/Crypto/Random/OSRNG/posix.py -> build/lib.linux-x86_64-2.7/Crypto/Random/OSRNG
copying lib/Crypto/Random/OSRNG/fallback.py -> build/lib.linux-x86_64-2.7/Crypto/Random/OSRNG
copying lib/Crypto/Random/OSRNG/nt.py -> build/lib.linux-x86_64-2.7/Crypto/Random/OSRNG
creating build/lib.linux-x86_64-2.7/Crypto/SelfTest
copying lib/Crypto/SelfTest/st_common.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest
copying lib/Crypto/SelfTest/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest
creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
copying lib/Crypto/SelfTest/Cipher/test_AES.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
copying lib/Crypto/SelfTest/Cipher/test_DES3.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
copying lib/Crypto/SelfTest/Cipher/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
copying lib/Crypto/SelfTest/Cipher/common.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
copying lib/Crypto/SelfTest/Cipher/test_ARC2.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
copying lib/Crypto/SelfTest/Cipher/test_Blowfish.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
copying lib/Crypto/SelfTest/Cipher/test_DES.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
copying lib/Crypto/SelfTest/Cipher/test_ARC4.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
copying lib/Crypto/SelfTest/Cipher/test_CAST.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
copying lib/Crypto/SelfTest/Cipher/test_XOR.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher
creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
copying lib/Crypto/SelfTest/Hash/test_MD5.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
copying lib/Crypto/SelfTest/Hash/test_SHA.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
copying lib/Crypto/SelfTest/Hash/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
copying lib/Crypto/SelfTest/Hash/common.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
copying lib/Crypto/SelfTest/Hash/test_HMAC.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
copying lib/Crypto/SelfTest/Hash/test_MD2.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
copying lib/Crypto/SelfTest/Hash/test_MD4.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
copying lib/Crypto/SelfTest/Hash/test_SHA256.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
copying lib/Crypto/SelfTest/Hash/test_RIPEMD.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Hash
creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Protocol
copying lib/Crypto/SelfTest/Protocol/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Protocol
copying lib/Crypto/SelfTest/Protocol/test_rfc1751.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Protocol
copying lib/Crypto/SelfTest/Protocol/test_chaffing.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Protocol
creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/PublicKey
copying lib/Crypto/SelfTest/PublicKey/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/PublicKey
copying lib/Crypto/SelfTest/PublicKey/test_DSA.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/PublicKey
copying lib/Crypto/SelfTest/PublicKey/test_importKey.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/PublicKey
copying lib/Crypto/SelfTest/PublicKey/test_RSA.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/PublicKey
creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random
copying lib/Crypto/SelfTest/Random/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random
copying lib/Crypto/SelfTest/Random/test_rpoolcompat.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random
copying lib/Crypto/SelfTest/Random/test_random.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random
creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/Fortuna
copying lib/Crypto/SelfTest/Random/Fortuna/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/Fortuna
copying lib/Crypto/SelfTest/Random/Fortuna/test_SHAd256.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/Fortuna
copying lib/Crypto/SelfTest/Random/Fortuna/test_FortunaGenerator.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/Fortuna
copying lib/Crypto/SelfTest/Random/Fortuna/test_FortunaAccumulator.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/Fortuna
creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
copying lib/Crypto/SelfTest/Random/OSRNG/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
copying lib/Crypto/SelfTest/Random/OSRNG/test_posix.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
copying lib/Crypto/SelfTest/Random/OSRNG/test_winrandom.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
copying lib/Crypto/SelfTest/Random/OSRNG/test_generic.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
copying lib/Crypto/SelfTest/Random/OSRNG/test_fallback.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
copying lib/Crypto/SelfTest/Random/OSRNG/test_nt.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Random/OSRNG
creating build/lib.linux-x86_64-2.7/Crypto/SelfTest/Util
copying lib/Crypto/SelfTest/Util/test_asn1.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Util
copying lib/Crypto/SelfTest/Util/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Util
copying lib/Crypto/SelfTest/Util/test_winrandom.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Util
copying lib/Crypto/SelfTest/Util/test_Counter.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Util
copying lib/Crypto/SelfTest/Util/test_number.py -> build/lib.linux-x86_64-2.7/Crypto/SelfTest/Util
creating build/lib.linux-x86_64-2.7/Crypto/Protocol
copying lib/Crypto/Protocol/AllOrNothing.py -> build/lib.linux-x86_64-2.7/Crypto/Protocol
copying lib/Crypto/Protocol/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/Protocol
copying lib/Crypto/Protocol/Chaffing.py -> build/lib.linux-x86_64-2.7/Crypto/Protocol
creating build/lib.linux-x86_64-2.7/Crypto/PublicKey
copying lib/Crypto/PublicKey/__init__.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
copying lib/Crypto/PublicKey/RSA.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
copying lib/Crypto/PublicKey/DSA.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
copying lib/Crypto/PublicKey/_slowmath.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
copying lib/Crypto/PublicKey/_DSA.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
copying lib/Crypto/PublicKey/qNEW.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
copying lib/Crypto/PublicKey/_RSA.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
copying lib/Crypto/PublicKey/pubkey.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
copying lib/Crypto/PublicKey/ElGamal.py -> build/lib.linux-x86_64-2.7/Crypto/PublicKey
running build_ext
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash.MD2' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
gcc -pthread -fno-strict-aliasing -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.7 -c src/MD2.c -o build/temp.linux-x86_64-2.7/src/MD2.o
src/MD2.c:31:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

谁能告诉我如何解决这个问题并在我的机器上成功安装 pycrypto-2.3。

4

4 回答 4

6

PyCrypto 在 Fedora 中称为 python-crypto,可以安装:

yum install python-crypto
于 2012-11-09T20:45:35.953 回答
2

首先阅读文档总是值得的。我将引用 pycrypto 的自述文件:

Red Hat 用户经常遇到这种情况,因为他们没有安装 python2-devel RPM。解决方法是简单地安装必要的 RPM。

编辑我要补充的是,不要从像 softpedia 这样的网站获取您的软件(尤其是加密软件!)。从pycrypto 网站获取并验证签名和文件哈希。

于 2012-08-08T09:52:40.793 回答
1

要解决这个问题,您只需要预先安装 python-devel。但是如果你像我一样使用 Fedora-23,你可能会面临另一个问题。所以你需要再安装一个包。

sudo dnf install redhat-rpm-config python-devel
于 2016-03-19T03:50:02.610 回答
0

在某些版本的 Fedora 中,需要安装以下软件包: dnf install deluge.

于 2016-09-06T00:50:26.300 回答