2017-04-03 2 views
-1

python 스크립트를 실행하려고하면 "ImportError : No modules netsnmp"라는 메시지가 나타납니다. 제발 좀 도와 줄래? 파이썬 스크립팅 경험이 없습니다.ImportError : No modules netsnmp

이것은 Icinga 용 플러그인 스크립트로 사용하고 싶습니다. 그래도 Icinga 서버에서 실행할 수는 없습니다. Icinga 서버는 Red Hat Linux이며 시간 전에 구성되었습니다. 어떤 도움이라도 대단히 감사 할 것입니다. 아래는 오류의 스크린 샷입니다. 당신의 도움이 당신의 도움을 위해


감사에 미리

[[email protected] ~]$ /usr/bin/check_snmp_idrac.py -h 
Traceback (most recent call last): 
File "/usr/bin/check_snmp_idrac.py", line 5, in <module> 
pkg_resources.run_script('health-monitoring-plugins==0.0.5', 'check_snmp_idrac.py') 
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 461, in run_script 
self.require(requires)[0].run_script(script_name, ns) 
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1194, in run_script 
execfile(script_filename, namespace, namespace) 
File "/usr/lib/python2.6/site-packages/health_monitoring_plugins-0.0.5-py2.6.egg/EGG-INFO/scripts/check_snmp_idrac.py", line 20, in <module> 
import netsnmp 
ImportError: No module named netsnmp 
[[email protected] ~]$ 

감사합니다. netsnmp-py3-0.3 python 패키지를 설치하려고 시도했지만 오류가 발생했습니다. 아래 오류에 대한 아이디어가 있습니까? 감사합니다

[[email protected] netsnmp-py3-0.3]# python setup.py install 
running install 
running bdist_egg 
running egg_info 
writing netsnmp_py.egg-info/PKG-INFO 
writing top-level names to netsnmp_py.egg-info/top_level.txt 
writing dependency_links to netsnmp_py.egg-info/dependency_links.txt 
reading manifest file 'netsnmp_py.egg-info/SOURCES.txt' 
writing manifest file 'netsnmp_py.egg-info/SOURCES.txt' 
installing library code to build/bdist.linux-x86_64/egg 
running install_lib 
running build_py 
running build_ext 
building 'netsnmp._api' extension 
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURC E -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC - fwrapv -fPIC -I./netsnmp -I/usr/include/python2.6 -c netsnmp/session.c -o build/temp.linux-x86_64-2.6/netsnmp/session.o 
netsnmp/session.c:1:20: error: Python.h: No such file or directory 
In file included from netsnmp/session.c:2: 
./netsnmp/_api.h:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
./netsnmp/_api.h:19: error: expected ‘)’ before ‘*’ token 
./netsnmp/_api.h:20: error: expected ‘)’ before ‘*’ token 
./netsnmp/_api.h:21: error: expected ‘)’ before ‘*’ token 
./netsnmp/_api.h:22: error: expected ‘)’ before ‘*’ token 
./netsnmp/_api.h:27: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
./netsnmp/_api.h:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
./netsnmp/_api.h:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
./netsnmp/_api.h:36: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
./netsnmp/_api.h:39: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
netsnmp/session.c:5:40: error: net-snmp/net-snmp-features.h: No such file or directory 
netsnmp/session.c:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
netsnmp/session.c:60: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
error: command 'gcc' failed with exit status 1 
[[email protected] netsnmp-py3-0.3]# 
+2

pip install <pynetsnmp> // missing pacakage name이 모듈을 설치 한을 snmpt있다? – Josh

답변

1

누락 된 패키지를 설치해야합니다.

파이썬 설치 도구가 없다면, 누락 된 패키지를 설치하십시오 (sudo apt-get install python-setuptools).

또는

sudo apt-get install net-snmp-python 

검사는 사용

Detailed information about installing missing python packages.

+0

도움 주셔서 감사합니다. 나는 netsnmp-py3-0.3 python 꾸러미를 설치하려고 노력했다. 그리고 무엇이 일어난다. 어떤 ides?
Alex