PCAP on Python 2.7
2012-04-24 10:19
281 查看
原文:http://code.google.com/p/pypcap/issues/detail?id=27
Reported by
ajcbl...@glam.ac.uk, Sep 15, 2010
Comment
1 by
tbjhdani...@gmail.com,
Oct 8, 2010
Comment
2 by
tbjhdani...@gmail.com,
Oct 8, 2010
Comment
3 by
sadashiv...@gmail.com,
Oct 27, 2010
Comment
5 by
crh0...@gmail.com,
Oct 27, 2010
Comment
6 by
crh0...@gmail.com,
Oct 27, 2010
Comment
7 by
ch...@csse.uwa.edu.au,
Feb 15, 2011
Comment
8 by
sander.j...@gmail.com,
May 24, 2011
Comment
9 by
japr...@gmail.com,
Jan 3, 2012
Comment
10 by
lifuling...@126.com,
Feb 28, 2012
Reported by
ajcbl...@glam.ac.uk, Sep 15, 2010
Has anyone got PCAP to run on Python 2.7
Comment
1 by
tbjhdani...@gmail.com,
Oct 8, 2010
Up
Comment
2 by
tbjhdani...@gmail.com,
Oct 8, 2010
Up
Comment
3 by
sadashiv...@gmail.com,
Oct 27, 2010
Not up yet... I'm getting following error with latest download gcc -pthread -fno-strict-aliasing -g -O2 -g -O0 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c pcap_ex.c -o build/temp.linux-i686-2.7-pydebug/pcap_ex.o pcap_ex.c:22:20: error: config.h: No such file or directory pcap_ex.c: In function ‘pcap_ex_fileno’: pcap_ex.c:165: error: dereferencing pointer to incomplete type pcap_ex.c: In function ‘pcap_ex_next’: pcap_ex.c:253: error: dereferencing pointer to incomplete type pcap_ex.c: In function ‘pcap_ex_compile_nopcap’: pcap_ex.c:285: warning: implicit declaration of function ‘mktemp’ error: command 'gcc' failed with exit status 1
Comment
5 by
crh0...@gmail.com,
Oct 27, 2010
I get the exact same thing on Mac OS X 10.6.4 Snow Leopard ^
Comment
6 by
crh0...@gmail.com,
Oct 27, 2010
Ok, I think I found a solution. Someone posted a patch here http://trac.umitproject.org/ticket/328 that seems to work! Save the following text to "python27patch" or whatever you want, save it in the same directory as the source code, and type: patch > python27patch. Then just do python setup.py build, pythonsetup.py install, worked for me. Index: pcap_ex.c =================================================================== --- pcap_ex.c (revision 85) +++ pcap_ex.c (working copy) @@ -12,7 +12,7 @@ # include <signal.h> # include <unistd.h> #endif - +#define HAVE_PCAP_FILE #include <pcap.h> #ifdef HAVE_PCAP_INT_H # include <pcap-int.h>
Comment
7 by
ch...@csse.uwa.edu.au,
Feb 15, 2011
Thanks for posting the info and patch in Comment 6. A tiny correction to the redirection- it should be patch < python27patch
Comment
8 by
sander.j...@gmail.com,
May 24, 2011
Hi, I can confirm adding the line "#define HAVE_PCAP_FILE" to pcap_ex.c (from pypcap-1.1) solves the error message below. (FWIW: Ubuntu 11.04, python 2.7) pcap.c:28:12: warning: ‘__Pyx_SetVtable’ declared ‘static’ but never defined pcap.c:29:12: warning: ‘__Pyx_GetVtable’ declared ‘static’ but never defined pcap.c:30:18: warning: ‘__Pyx_CreateClass’ declared ‘static’ but never defined gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include -I/usr/include/python2.7 -c pcap_ex.c -o build/temp.linux-x86_64-2.7/pcap_ex.o pcap_ex.c: In function ‘pcap_ex_fileno’: pcap_ex.c:165:16: error: dereferencing pointer to incomplete type pcap_ex.c: In function ‘pcap_ex_next’: pcap_ex.c:253:12: error: dereferencing pointer to incomplete type pcap_ex.c: In function ‘pcap_ex_compile_nopcap’: pcap_ex.c:285:2: warning: implicit declaration of function ‘mktemp’ error: command 'gcc' failed with exit status 1 make: *** [all] Error 1
Comment
9 by
japr...@gmail.com,
Jan 3, 2012
I had to use this patch in addition to the one above, to work with Ubuntu 10.11 (oneiric): --- setup.py 2005-10-16 19:07:03.000000000 -0400 +++ setup.py 2012-01-03 12:22:04.761298898 -0500 @@ -46,7 +46,7 @@ incdirs = [ os.path.join(d, sd) ] if os.path.exists(os.path.join(d, sd, 'pcap.h')): cfg['include_dirs'] = [ os.path.join(d, sd) ] - for sd in ('lib', ''): + for sd in ('lib', 'lib/i386-linux-gnu'): for lib in (('pcap', 'libpcap.a'), ('pcap', 'libpcap.dylib'), ('wpcap', 'wpcap.lib')):
Comment
10 by
lifuling...@126.com,
Feb 28, 2012
look at here:http://code.google.com/p/pypcap/issues/detail?id=36
相关文章推荐
- Install OpenCV 3.0 and Python 2.7+ on Ubuntu
- Installing Python 2.7 on Ubuntu 10.04
- How to install Python 2.7 and Python 3.3 on CentOS 6
- How to install Python 2.7 and Python 3.3 on CentOS 6
- Install Python 2.7 on web sharing host
- Installing Python 2.7 on Ubuntu
- How to Install Python 2.7 on CentOS6.5
- Installing Python 2.7 on Centos 6.5
- Installing OpenCV on Windows 7 for Python 2.7
- python2.7 安装pypcap出错 pcap.h not found
- 解决Python2.7 连接MySQL数据库遇到'can't connect to MySQL server on 'localhost'(10061)'问题
- install Python 2.7 and Python 3.3 on CentOS 6
- python2.7安装numpy报错:is not a supported wheel on...
- install opencv3 with python2.7 bindings on Mac using Hombrew and git
- Install Rouge and Pyrouge for python 2.7 (conda virtual env) on Linux 64
- Python 2.7 install on centos 6.5
- python2.7 安装pypcap出错 pcap.h not found
- Mac OSX 正確地同時安裝 Python 2.7 和 Python3 By Candy Tsai In Come on~ Python 11-29-2015 2 Min read 8 comme
- How to install Python 2.7 and Python 3.3 on CentOS 6
- How to uninstall Python 2.7 (installed by yourself) on a Mac OS