Python scapy module installation and dependency module

Scapy module installation

Windows:
PIP install scapy
successfully installed.
mac:

pip install scapy

Unexpectedly prompt permission problem, then

sudo pip install scapy

Or an error permission denied
so query on the Internet, found that the original MAC system caused by the sip mechanism.
reference: reference link

sudo pip install scapy --user -U

Installation successful.
Scapy module is installed with
and used.

>>python
>>import scapy

No problem. I thought the installation was successful, so I started writing code. Reference code links:

http://blog.csdn.net/hitwangpeng/article/details/49278409 found that at the time of import module after error:

from scapy.all import *

If you encounter an error that does not exist in the module, you simply need PIP Install XX to install the corresponding module.
MAC encountered this error:

importError: No module named pcapy

Then install the PCAPY module and encounter the same permission problem. Use:

pip install pcapy --user -U

After the installation, an error occurred:

ImportError: No module named dumbnet

When installing with PIP, the module did not exist, and I was surprised to find a suitable solution after a web search:
download the source code and install using setup.py.
reference link: https://stackoverflow.com/questions/40272077/importerror-no-module-named-dumbnet-when-trying-to-run-a-script-that-leverage

git clone https://github.com/dugsong/libdnet.git
cd libdnet
./configure && make
cd python
python setup.py install

At this point, the MAC installation is complete and the script Demo mentioned at the beginning of the test is successful.
But Windows encountered a strange error:

    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126]

The error message goes up to trace, sees is in loads wpcap.DLL this module times gives the error, therefore, searches in the computer, discovers as expected my machine does not have wpcap.DLL file, searches on the net, discovers can oneself download installs wpcap.DLL module. Specific methods, refer to the tutorial, I’m in the way a, has not been successful, then after use method 2 is very effective, recommend to you
reference links: http://www.jb51.net/os/windows/378774.html
Once the installation is complete, import IT and run the script. praise

Read More: