python - pip3 install m2crypto
¿Cómo instalo M2Crypto en Ubuntu? (2)
Estoy tratando de construir e instalar M2Crypto en Ubuntu 10.04 LTS. Descargué y anulé M2Crypto-0.20.2.tar, y desde el directorio M2Crypto-0.20.2 probé python setup.py build
. Tengo un error porque no tengo un trago. Así que corrí sudo apt-get install swig
. Luego probé python setup.py build
nuevamente y obtuve:
/usr/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: ''test_suite''
warnings.warn(msg)
running build
running build_py
running build_ext
building ''M2Crypto.__m2crypto'' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -I/usr/include/python2.6 -I/usr/include -includeall -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
SWIG/_bio.i:64: Warning(454): Setting a pointer/reference variable may leak memory.
SWIG/_rand.i:19: Warning(454): Setting a pointer/reference variable may leak memory.
SWIG/_evp.i:156: Warning(454): Setting a pointer/reference variable may leak memory.
SWIG/_dh.i:36: Warning(454): Setting a pointer/reference variable may leak memory.
SWIG/_rsa.i:43: Warning(454): Setting a pointer/reference variable may leak memory.
SWIG/_dsa.i:31: Warning(454): Setting a pointer/reference variable may leak memory.
SWIG/_ssl.i:207: Warning(454): Setting a pointer/reference variable may leak memory.
SWIG/_x509.i:313: Warning(454): Setting a pointer/reference variable may leak memory.
SWIG/_pkcs7.i:42: Warning(454): Setting a pointer/reference variable may leak memory.
SWIG/_pkcs7.i:42: Warning(454): Setting a pointer/reference variable may leak memory.
SWIG/_util.i:9: Warning(454): Setting a pointer/reference variable may leak memory.
SWIG/_ec.i:111: Warning(454): Setting a pointer/reference variable may leak memory.
SWIG/_engine.i:162: Warning(454): Setting a pointer/reference variable may leak memory.
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -I/usr/include -I/home/dspitzer/M2Crypto-0.20.2/SWIG -c SWIG/_m2crypto_wrap.c -o build/temp.linux-i686-2.6/SWIG/_m2crypto_wrap.o -DTHREADING
SWIG/_m2crypto_wrap.c:126:20: error: Python.h: No such file or directory
SWIG/_m2crypto_wrap.c:757: error: expected ‘)’ before ‘*’ token
SWIG/_m2crypto_wrap.c:781: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
...y así.
¿Alguien ha tenido éxito en hacer esto?
Actualización: cambié el título, ya que no se me ocurrió que M2Crypto sería un paquete de Ubuntu precompilado.
¿tienes el paquete python2.6-dev instalado? este es el paquete que contiene el archivo Python.h que falta
Probablemente necesites instalar los paquetes de desarrollo de python:
sudo apt-get install python-dev
Mejor aún, no te molestes en construir m2crypto. Ya está en los repositorios de Ubuntu como un paquete totalmente compatible. De esta manera, obtendrá actualizaciones automáticas a través de los mismos medios que el resto de su sistema Ubuntu:
sudo apt-get install python-m2crypto