use*_*ser 8 python python-2.7 net-snmp
我在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
Run Code Online (Sandbox Code Playgroud)
我似乎也成功安装了net-snmp的Python绑定.这包含在net-nsmp下载中,作为其中包含文件的标题为"Python"的不同文件夹setup.py.但是在运行命令时python setup.py test我发现了一些问题.我认为这可能没有什么可担心的,所以我继续执行python setup.py install我不知道README文件中的说明是什么意思,"python setup.py test(需要一个本地运行的代理w/config提供)".所以,这就是我用失败的测试安装它的原因.无论如何,我不确定这是否是一个问题.
在成功安装net-snmp的python绑定后,我将目录切换回我的桌面并打开了一个交互式python shell.从这里我导入netsnmp模块并收到以下错误.它几乎看起来在变量netsnmp_memdup中有一个拼写错误,它会在Traceback中引发错误.这看起来像是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
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这个问题?我在sourceforge的邮件列表页面上查看了这个项目并搜索了supoort档案但没有找到任何内容.
感谢收听疯狂男人的Python问题.
节日快乐,
user_loser
Alrgihty,感谢我的好朋友Naveen,我们已将其追溯到5.7.3中Python Net-SNMP绑定中的实际错误.
有两种方法: