Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy
 

How to install scapy via python pip




scapy - Scapy: interactive packet manipulation tool, it belongs to Classifiers:

- Intended Audience :: Information Technology
- Intended Audience :: System Administrators
- Intended Audience :: Telecommunications Industry
- License :: OSI Approved :: GNU General Public License v2 (GPLv2)
- Topic :: Security
- Topic :: System
- Topic :: System :: Networking
- Topic :: System :: Networking :: Monitoring

When you know about this project and you want to new install scapy to support your project or you get trouble as ModuleNotFoundError: No module named "scapy" or ImportError: cannot import name "scapy" in your project, let follow this tutorial to install scapy



Installation:

Step 1: First, ensure you installed pip in your os, to check pip has been installed on your computer

In Windows (CMD):

py -m pip --version

In Unix/macOS:

python3 -m pip --version

Ensure pip, setuptools, and wheel are up to date:

In Windows (CMD):

py -m pip install --upgrade pip setuptools wheel

In Unix/macOS:

python3 -m pip install --upgrade pip setuptools wheel


Optional - If you want to install in virtual environment:

In Windows (CMD):

- Install virtualenv - if you installed it, please ignore

py -m pip install --user virtualenv

- Create a virtual environment

py -m venv test_scapy_env

- Active the virtual environment

test_scapy_env\Scripts\active

In Unix/macOS:

- Install virtualenv - if you installed it, please ignore

pip3 install virtualenv

- Create a virtual environment

python3 -m venv test_scapy_env

- Active the virtual environment

source test_scapy_env/bin/active


Step 2: OK, now, let flow below content to start the installation scapy

To install scapy on Windows(CMD):

py -m pip install scapy

To install scapy on Unix/macOs:

pip install scapy


Step 3: If you want to install a specific scapy version, add ==<scapy version> to the end command line

Example:

pip install scapy==2.2.0-dev                                                        pre-release


Please see the version list below table:

VersionReleased dateCommand
scapy 2.4.52021-04-19T18:29:34Windows:

py -m pip install scapy==2.4.5

Unix/macOs:

pip install scapy==2.4.5

scapy 2.4.42020-09-02T18:20:08Windows:

py -m pip install scapy==2.4.4

Unix/macOs:

pip install scapy==2.4.4

scapy 2.4.32019-08-06T23:44:48Windows:

py -m pip install scapy==2.4.3

Unix/macOs:

pip install scapy==2.4.3

scapy 2.4.22019-01-10T19:02:19Windows:

py -m pip install scapy==2.4.2

Unix/macOs:

pip install scapy==2.4.2

scapy 2.4.12019-01-10T08:10:28Windows:

py -m pip install scapy==2.4.1

Unix/macOs:

pip install scapy==2.4.1

scapy 2.4.02018-03-27T09:28:26Windows:

py -m pip install scapy==2.4.0

Unix/macOs:

pip install scapy==2.4.0

scapy 2.3.32016-10-18T13:24:44Windows:

py -m pip install scapy==2.3.3

Unix/macOs:

pip install scapy==2.3.3

scapy 2.3.22016-01-29T08:51:51Windows:

py -m pip install scapy==2.3.2

Unix/macOs:

pip install scapy==2.3.2

scapy 2.3.12014-12-30T20:35:14Windows:

py -m pip install scapy==2.3.1

Unix/macOs:

pip install scapy==2.3.1


Step 4: Otherwise, you can install scapy from local archives:

Download the distribution file from scapy-2.4.5.tar.gz or the specific scapy version in the below list of distribution

After that, install by command:

On Windows(CMD):

py -m pip install <path_to_scapy_downloaded_file>

On Unix/macOs:

pip install <path_to_scapy_downloaded_file>


List distribution:


Project link:

- Homepage
- Download
- Documentation
- Source Code