python - 为什么我不能在这个简单的应用程序中使用 scapy 模块?引发异常
问题描述
我是 Python 的新手,我发现在我正在处理的应用程序中使用scapy模块时遇到了一些困难。我在 Kali Linux 系统上使用 PyCharm 在 Python 3 中进行开发。
我安装了执行此命令的scapy :
pip install scapy-python3
Collecting scapy-python3
Downloading https://files.pythonhosted.org/packages/4f/f3/e33d21e25b0dda2ffeebcc3ad06d26eff7f913c9b8b397c30f443b68b8e4/scapy-python3-0.26.tar.gz
Installing collected packages: scapy-python3
Running setup.py install for scapy-python3 ... done
Successfully installed scapy-python3-0.26
好的,这是我的代码:
#!/usr/bin/env python
import scapy.all as scapy
def scan(ip):
scapy.arping(ip)
scan("MY_IP_ADDRESS")
问题是从 PyCharm 运行此脚本时,我收到以下错误消息:
/root/Documents/PycharmWS/network_scanner/venv/bin/python /root/Documents/PycharmWS/network_scanner/network_scanner.py
Traceback (most recent call last):
File "/root/Documents/PycharmWS/network_scanner/network_scanner.py", line 3, in <module>
import scapy.all as scapy
File "/root/Documents/PycharmWS/network_scanner/venv/lib/python3.7/site-packages/scapy/all.py", line 5, in <module>
raise Exception(msg)
Exception:
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.
You should use either pip package kamene for scapy3k (see http://github.com/phaethon/kamene for differences in use) or mainstream scapy (pip package scapy, http://github.com/secdev/scapy).
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.
You should use either pip package kamene for scapy3k (see http://github.com/phaethon/kamene for differences in use) or mainstream scapy (pip package scapy, http://github.com/secdev/scapy).
Process finished with exit code 1
为什么?怎么了?我错过了什么?我该如何尝试解决此问题?
解决方案
推荐阅读
- android - 就如何申请申请征求意见
- c# - 更优雅的 LINQ 替代 Foreach 扩展
- google-app-engine - 如何使用 logback 从谷歌应用引擎将 jsonPayload 作为 jsonPayload 记录到堆栈驱动程序?
- arrays - PostgreSQL JSON 构建一个没有空值的数组
- javascript - 使用递归分解一个数字
- node.js - 如何将来自 Firestore 查询的数据保存在变量中?
- javascript - 从ajax存储变量
- javascript - 如何过滤字符串数组以检测有效 URL?
- python - 返回 Python 中的封闭范围变量
- amazon-web-services - 触发退回事件时,Amazon SNS 不发送通知