3

So I used to be able to import scapy's base64_bytes by using from scapy.all import base64_bytes. However, I get this error when I do that:

PIP package scapy-python3 used to provide scapy3k, which was a fork from scapy implementing python3 compatibility since 2016. This package was included in some of the Linux distros under name of python3-scapy. Starting from scapy version 2.4 (released in March, 2018) mainstream scapy supports python3. To reduce any confusion scapy3k was renamed to kamene.

I tried renaming it to from kamene.all import base64_bytes, but still no luck. Is there any other alternative to base64_bytes or am I just importing it incorrectly?

joe brown
  • 33
  • 1
  • 3

1 Answers1

4

There is a lot of confusion between Scapy and kamene. From https://scapy.net

An independent fork of Scapy was created from v2.2.0 in 2015, aimed at supporting only Python3 (scapy3k). The fork diverged, did not follow evolutions and fixes, and has had its own life without contributions back to Scapy. Unfortunately, it has been packaged as python3-scapy in some distributions, and as scapy-python3 on PyPI leading to confusion amongst users. It should not be the case anymore soon. Scapy supports Python3 in addition to Python2 since 2.4.0. Scapy v2.4.0 should be favored as the official Scapy code base. The fork has been renamed as kamene.

You are using kamene, and old Scapy fork with no support whatsoever.

You probably have installed scapy-python3 on PyPI. Uninstall it and use pip3 install scapy

NOT to use kamene is the best advice I can give you...

Cukic0d
  • 5,111
  • 2
  • 19
  • 48
  • I uninstalled `scapy-python3` and `scapy` was already installed on my system. But, it won't let me import scapy after uninstalling `scapy-python3`. – joe brown Feb 07 '19 at 17:20
  • Check it is installed on the Python version you use to start your script. Use `python-m pip install scapy` (replace `python` if you use miniconda.....) – Cukic0d Feb 07 '19 at 17:21
  • 1
    nevermind, I uninstalled then reinstalled scapy and it works perfectly fine now. Thank you! – joe brown Feb 07 '19 at 17:30