1,我通过“configure; make; make install”安装了libnet,它返回成功:
make[1]: Leaving directory `/data/home/fiontools/pcap/tool/libnet-1.2-rc3/win32'
make[1]: Entering directory `/data/home/fiontools/pcap/tool/libnet-1.2-rc3'
make[2]: Entering directory `/data/home/fiontools/pcap/tool/libnet-1.2-rc3'
/bin/mkdir -p '/usr/local/bin'
/usr/bin/install -c libnet-config '/usr/local/bin'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/data/home/fiontools/pcap/tool/libnet-1.2-rc3'
make[1]: Leaving directory `/data/home/fiontools/pcap/tool/libnet-1.2-rc3'
2,安装pylibnet,也返回成功。
python setup.py install
Searching for libnet...
/usr/local/include/
running install
running build
running build_ext
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/bin/lnsh to 755
running install_egg_info
Removing /usr/lib64/python2.6/site-packages/pylibnet-3.0rc1-py2.6.egg-info
Writing /usr/lib64/python2.6/site-packages/pylibnet-3.0rc1-py2.6.egg-info
3,当我使用libnet时,它没有返回libnet.so:
python
Python 2.6.6 (r266:84292, Dec 7 2011, 20:48:22)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libnet
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: libnet.so.9: cannot open shared object file: No such file or directory
>>>
答案 0 :(得分:0)
通过添加lib路径解决了问题:
super.init()