繁体   English   中英

Python 2绑定Net-SNMP错误-未定义符号:netsnmp-memdup

[英]Python 2 Bindings Net-SNMP Error - undefined symbol: netsnmp-memdup

我在Ubuntu上成功编译了net-snmp-5.7.3。 :D这是Ubuntu的特定版本:

Linux loserBox 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

我似乎也已经成功地为net-snmp安装了Python绑定。 这是包含在net-nsmp下载中的,为另一个名为“ Python”的文件夹,其中包含setup.py文件。 但是,当运行命令python setup.py test我注意到了一些问题。 我以为这可能没什么好担心的,所以我继续执行python setup.py install我不确定自述文件中的说明是什么,即“ python setup.py test(需要本地运行的代理w / config)提供)”。 因此,这就是为什么我在测试失败时安装它的原因。 无论如何,我不确定这是否是问题。

成功安装net-snmp的python绑定后,我将目录切换回了我的桌面,并打开了一个交互式python shell。 从这里,我导入了netsnmp模块,并收到以下错误。 几乎像变量netsnmp_memdup中存在拼写错误,该错误将在Traceback中netsnmp_memdup该错误。 这看起来像是C代码而不是python的问题。

Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import netsnmp
/usr/lib/python2.7/dist-packages/pkg_resources.py:1031: UserWarning: 
/home/loser_user/.python-eggs is writable by group/others and vulnerable to attack
when used with get_resource_filename. Consider a more secure location 
(set with   .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "build/bdist.linux-x86_64/egg/netsnmp/__init__.py", line 1, in <module>
File "build/bdist.linux-x86_64/egg/netsnmp/client.py", line 1, in <module>
File "build/bdist.linux-x86_64/egg/netsnmp/client_intf.py", line 7, in <module>
File "build/bdist.linux-x86_64/egg/netsnmp/client_intf.py", line 6, in __bootstrap__
ImportError: /home/loser_user/.python-eggs/netsnmp_python-1.0a1-py2.7-linux-x86_64.egg-  
tmp/netsnmp/client_intf.so: undefined symbol: netsnmp_memdup

有谁知道如何解决这个问题? 我查看了sourceforge上该项目的邮件列表页面,并搜索了supoort档案,但没有找到任何东西。

感谢您收听疯狂的人的Python问题。

节日快乐,

user_loser

Alrgihty,感谢我的好朋友Naveen,我们已将其追溯到5.7.3中Python Net-SNMP绑定中的实际错误。

有两种解决方法:

  1. 在Net-SNMP 5.7.2中使用Python绑定
  2. 在Net-SNMP Python库的分支上看到此提交(仅从昨天开始,所以请耐心等待): https : //github.com/fgimian/easysnmp/commit/fa86af977b563f65e7d70243752d48b94a8d5686并将其复制到您的Net-SNMP下载中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM