I have recently taken up learning networks, and I want to install scapy. I have downloaded the latest version (2.2.0), and have two versions of python on my computer- 2.6.1 and 3.3.2. My OS is windows 7 64 bit.
After extracting scapy and navigating to the correct folder in the terminal, I was instructed to run "python setup.py install". I get the following error-
File "setup.py", line 35
os.chmod(fname,0755)
................................^
......................invalid token
(dots for alignment)
How do I solve this problem?
If
pip
installation is causing problem. You can download usingwget
and try to install.Check here for all ways of installing scapy.
Change os.chmod(fname,0755) to os.chmod(fname,0o755) and re-run
Scapy mainly used on uinx-liked OS, and can't install by pip. But they offered msi installer for windows:
http://www.secdev.org/projects/scapy/doc/installation.html
The error also occurs on Linux, but virtualenv saves me.Virtualenv is a really good solution of using different version python or librarys on one OS.
Creating a virtual env with python2 and python3:
Then active the env, and install the requirements.
And using deactivate to exit env.
The following works for me on Python 3.5
Update:
scapy-python3
is deprecated (2018) and will no longer be updated.scapy>=2.4.0
has merged python 3 compatibility.The most up-to-date installation method is now
You may check the installation page in the documentation for other installation methods
Original answer:
Perhaps you are trying to install the package scapy for Python 2, but you need the one for Python 3.
gave this error:
while
did a proper install.
This error means the octal number is not recognized by Python 3, see PEP 3127: