Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2绑定网络SNMP错误-未定义符号:netsnmp memdup_Python_Python 2.7_Net Snmp - Fatal编程技术网

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

Python 2绑定网络SNMP错误-未定义符号:netsnmp memdup,python,python-2.7,net-snmp,Python,Python 2.7,Net Snmp,我在Ubuntu上成功编译了net-snmp-5.7.3D这是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 我似乎也成功地安装了NetSNMP的Python绑定。这作为一个名为“Python”的不同文件夹包含在NetNSMP下载中,其中包含setup.py文件。但是,在运行命令python setup

我在Ubuntu上成功编译了net-snmp-5.7.3D这是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
我似乎也成功地安装了NetSNMP的Python绑定。这作为一个名为“Python”的不同文件夹包含在NetNSMP下载中,其中包含
setup.py
文件。但是,在运行命令
python setup.py test
时,我注意到一些问题。我认为这可能没什么好担心的,所以我继续执行了
python setup.py install
我不确定自述文件中的说明是什么,上面说,“python setup.py test(需要提供本地运行的代理w/config)”。所以,这就是为什么我安装了失败的测试或其他东西。无论如何,我不确定这是否是一个问题

成功安装NetSNMP的python绑定后,我将目录切换回桌面,并打开了一个交互式python shell。从这里我导入了
netsnmp
模块,并收到以下错误。看起来变量
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
Python 2.7.6(默认,2014年3月22日,22:59:56)
[GCC 4.8.2]关于linux2
有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证”。
>>>导入netsnmp
/usr/lib/python2.7/dist packages/pkg_resources.py:1031:UserWarning:
/home/losser\u user/.python可由组/其他人写入,易受攻击
与get_资源_文件名一起使用时。考虑更安全的位置
(使用.set_extraction_path或PYTHON_EGG_CACHE环境变量设置)。
警告。警告(消息,用户警告)
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“build/bdist.linux-x86_64/egg/netsnmp/_init__uuu.py”,第1行,在
文件“build/bdist.linux-x86_64/egg/netsnmp/client.py”,第1行,在
文件“build/bdist.linux-x86_64/egg/netsnmp/client_intf.py”,第7行,在
文件“build/bdist.linux-x86_64/egg/netsnmp/client_intf.py”,第6行,在引导程序中__
ImportError:/home/loss\u user/.python-eggs/netsnmp\u python-1.0a1-py2.7-linux-x86\u 64.egg-
tmp/netsnmp/client_intf.so:未定义的符号:netsnmp_memdup
有人知道如何解决这个问题吗?我在sourceforge的邮件列表页面上查看了这个项目,搜索了supoort档案,但没有找到任何东西

感谢您收听一位疯子的Python问题

节日快乐


user_loser

Alrghity,多亏了我的好朋友Naveen,我们将此追溯到了5.7.3中Python Net SNMP绑定中的一个实际错误

有两种解决方法:

  • 使用NetSNMP 5.7.2中的Python绑定
  • 请在我们的NetSNMP Python库分支上查看此提交(昨天才开始,请耐心等待):并在下载的NetSNMP中复制此提交

  • 我在Ubuntu 14.04上遇到了同样的问题。哇,谢谢你的回复!:读github上显示差异数据的C代码很有趣。如果我需要再次使用,我将不得不尝试你的解决方案。我打赌这些信息对互联网上的其他人有帮助。快乐编码。保持冷静。@user#u loser:你不是唯一一个高兴听到这个修复的人——我已经被困了一个月了——选项1对我有效。