Take the 2-minute tour ×

When I check the attributes available to the module pcap, I expect to see something like

[ ...snip...

'dltvalue', 'findalldevs', 'lookupdev', 'lookupnet', 'ntoa', 'pcapObject', 'pcapObjectPtr']

With note on pcapObject. However, all I get when running dir(pcap) is

[ ... snip... 'copyright', 'doc', 'file', 'license', 'name', 'url', 'version', 'bpf', 'dltoff', 'ex_name', 'lookupdev', 'pcap', 'sys']

Noting the lack of pcapObject. Why is this? What could cause this?

share|improve this question
This happened for me too--Mac OSX 10.4? –  twneale Nov 21 '10 at 14:06

2 Answers 2

You want pylibpcap but what you have installed is pypcap, a different Python libpcap binding with an incompatible API.

There are three Python libpcap bindings used in the wild: pypcap (recommended by scapy for use on Windowas), pylibcap and pcapy. See scapy/pcapdnet.py for a taste of their API differences. With their similar names people must have them mixed up pretty regularly ...

share|improve this answer

You could also try

sudo apt-get install libpcap-dev

share|improve this answer

Your Answer


