那么既然 Scapy 已经重命名为 Kamene,我将如何导入和使用 base64_bytes?

So since Scapy has been renamed to Kamene, how would I import and use base64_bytes?

所以我以前可以通过from scapy.all import base64_bytes导入scapy的base64_bytes。但是,当我这样做时出现此错误:

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.

我尝试将其重命名为 from kamene.all import base64_bytes,但仍然没有成功。 base64_bytes 是否还有其他替代方案,或者我只是错误地导入了它?

Scapy 和 kamene 之间有很多混淆。来自 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.

您正在使用 kamene 和没有任何支持的旧 Scapy 分支。

您可能已经在 PyPI 上安装了 scapy-python3。卸载它并使用 pip3 install scapy

不要使用 kamene 是我能给你的最好建议...