2016-03-22 7 views
1

nicht installieren Ich bin neu in Python. Ich möchte pysnmp Modul verwenden, so dass ich versuchte es mit pip zu installieren, aber ich bin immer Fehler von ihm:Kann Modul python pip

Failed building wheel for pycrypto 

Ich habe versucht, auf mehrere System (Ubuntu, Debian und RH) und ich immer das bekommen gleicher Fehler Wie kann ich pysnmp installieren? Oder gibt es eine andere Alternative, um mit snmp mit Python zu arbeiten?

Shell-Befehl:

sudo -H pip install pysnmp 

Ergebnis:

... 
    configure: creating ./config.status 
    config.status: creating src/config.h 
    warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastm                         ath. 
    building 'Crypto.Hash._MD2' extension 
    creating build/temp.linux-x86_64-3.4 
    creating build/temp.linux-x86_64-3.4/src 
    x86_64-linux-gnu-gcc -pthread -fwrapv -Wall -Wstrict-prototypes -fstack-prot                         ector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOUR                         CE=2 -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python3.4m -c                         src/MD2.c -o build/temp.linux-x86_64-3.4/src/MD2.o 
    src/MD2.c:31:20: fatal error: Python.h: No such file or directory 
    #include "Python.h" 
         ^
    compilation terminated. 
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

    ---------------------------------------- 
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-                         build-7gwchpkq/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(_                         _file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp                         /pip-6mlabkyq-record/install-record.txt --single-version-externally-managed --co                         mpile" failed with error code 1 in /tmp/pip-build-7gwchpkq/pycrypto/ 
+0

versucht, beide 'sudo pip installieren pysnmp' und' sudo -H pip installieren pysnmp' und es funktionierte. Ich deinstallierte auch 'pycrypto' und installierte es neu, arbeitete – Mrlenny

Antwort

3

src/MD2.c:31:20 : fatal error: Python.h : No such file or directory

Der eigentliche Fehler ist, dass Sie nicht die DEV-Dateien für Python-Sprache haben (python.h nicht gefunden).

So installieren python-dev:

sudo apt-get install python-dev 
+0

Das war es, vielen Dank – Nicox11

0

Versuchen,

wget https://bootstrap.pypa.io/ez_setup.py 

python ez_setup.py 

easy_install pysnmp 
+0

Ich bekomme das: Laufende pycrypto-2.6.1/setup.py -q bdist_egg --dist-dir/tmp/easy_install-g0ahfypn/pycrypto-2.6.1/egg -dist-tmp-20rtwgcx Warnung: GMP- oder MPIR-Bibliothek nicht gefunden; Crypto.PublicKey._fastmath wird nicht erstellt. src/MD2.c: 31: 20: Schwerwiegender Fehler: Python.h: Keine solche Datei oder kein Verzeichnis #include "Python.h" ^ Kompilierung beendet. Fehler: Setup-Skript mit Fehler beendet: Befehl 'x86_64-linux-gnu-gcc' mit Exit-Status 1 fehlgeschlagen – Nicox11

0

Versuchen:

sudo pip install setuptools --upgrade 
+0

Ich bekomme "Voraussetzung bereits update: setuptools in/usr/local/lib/python3.4/dist packages/setuptools-20.3.1-py3.4.egg " – Nicox11

+1

Ich habe das auf einem anderen Thread gefunden:' apt-cache suche python3-dev' 'sudo apt-get installiere python3-dev' ' pip install pycrypto' – Bobby