12

可能重复:
找不到 PyCrypto 和 GMP 库错误 [Mac OS 10.6.3]

我正在尝试在 ubuntu 上安装 pycrypto,但它会引发错误

hom@PC71:~/Desktop/pycrypto-2.3$ sudo python setup.py build
running build
running build_py
running build_ext
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash.MD2' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/MD2.c -o build/temp.linux-i686-2.6/src/MD2.o
src/MD2.c:31: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

我已经安装了 python-dev 工具。

4

1 回答 1

42

您缺少 Python 开发库。(尝试apt-get install python-dev。)

但是,除非您有正当理由自己编译 pycrypto,否则只需通过 (I think) 安装它apt-get install python-crypto

于 2011-10-21T07:27:36.937 回答