Scapy – Safe and Complete Installation

Here are steps for safe and complete installation of Scapy on your Ubuntu/Fedora machine.

Step 1: Install VirtualEnv

Once this is installed, we will create a virtual environment and do all the further installation in that virtual environment. Read more about virtualenv.

$ sudo pip install virtualenv

Create virtual environment named venv

$ virtualenv venv

Activate virtual environment. After activating virtual environment the shell prompt changes and name of virtual environment is appended to prompt.

$ source venv/bin/activate

This post is called safe installation because we are not doing system wide installation of softwares but in a virtual environment. So every time for using any software installed in virtual environment you will have to activate virtual environment as shown above.

Step 2: Install Scapy from source code

(venv)$ wget 
(venv)$ unzip scapy*
(venv)$ cd scapy-2.*
(venv)$ python install

Or else download source from the link unzip it and install it.
Now scapy is installed but some functionalities won’t work because those functionalities depend upon external softwares that should be installed manually, externally.

Step 3: OS specific Requirements

Install Python-development tools and TCPDUMP.


(venv)$ sudo dnf install python-devel tcpdump graphviz sox

Note: dnf is a newer package manager, for older versions of Fedora use yum instead.


(venv)$ sudo apt-get install python-dev tcpdump graphviz imagemagick

Step 4: Install Python graphics package

This library is needed by Scapy when it generates a graphical representation of packets. Read the documentation of PyX.

(venv)$ pip install --allow-external pyx pyx==0.12.1

Step 5: INSTALL Numpy

Numpy is a dependency of GNUplot, read about that here.

(venv)$ pip install numpy

Step 6: Install GNUPlot

  • Download the source from here. If there are problems in downloading read here about downloading source code.
  • Extract the downloaded tar and go into folder
(venv)$ python install

Step 7: Install PyCrypto

(venv)$ pip install pycrypto

After this scapy is completely installed now you can run scapy. But scapy needs root access to do stuff so login as root, activate the virtual environment and then run following.

(venv)$ scapy

Try this installation process, if anything is missing or you find anything wrong, please comment below. Thanks for reading.


8 thoughts on “Scapy – Safe and Complete Installation

  1. I want to install scapy in windows 10,i am using python 2.7.13 but the problem is that windows saying no module scapy.all found and when i tried to use ” from scapy import*, and i tried to send packet like ” sr1(IP(dst=””)/ICMP())
    it is saying that the name “sr1” is not defined


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s