ImportError: cannot import name 'send' from partially initialized module 'scapy.sendrecv' (most likely due to a circular import)
boluobaowangzi opened this issue · 1 comments
thrift-tool --port 9090 --pcap-file ~/share.pcap dump --show-all --pretty
Traceback (most recent call last):
File "/Users/hq/Library/Python/3.8/bin/thrift-tool", line 11, in
from thrift_tools.tool import main
File "/Users/hq/Library/Python/3.8/lib/python/site-packages/thrift_tools/tool.py", line 13, in
from .message_sniffer import MessageSnifferOptions, MessageSniffer
File "/Users/hq/Library/Python/3.8/lib/python/site-packages/thrift_tools/message_sniffer.py", line 8, in
from .sniffer import Sniffer
File "/Users/hq/Library/Python/3.8/lib/python/site-packages/thrift_tools/sniffer.py", line 13, in
from scapy.sendrecv import sniff
File "/Users/hq/Library/Python/3.8/lib/python/site-packages/scapy/sendrecv.py", line 61, in
import scapy.route # noqa: F401
File "/Users/hq/Library/Python/3.8/lib/python/site-packages/scapy/route.py", line 218, in
conf.route = Route()
File "/Users/hq/Library/Python/3.8/lib/python/site-packages/scapy/route.py", line 37, in init
self.resync()
File "/Users/hq/Library/Python/3.8/lib/python/site-packages/scapy/route.py", line 45, in resync
from scapy.arch import read_routes
File "/Users/hq/Library/Python/3.8/lib/python/site-packages/scapy/arch/init.py", line 124, in
from scapy.arch.bpf.supersocket import * # noqa F403
File "/Users/hq/Library/Python/3.8/lib/python/site-packages/scapy/arch/bpf/supersocket.py", line 27, in
from scapy.layers.l2 import Loopback
File "/Users/hq/Library/Python/3.8/lib/python/site-packages/scapy/layers/l2.py", line 17, in
from scapy.ansmachine import AnsweringMachine
File "/Users/hq/Library/Python/3.8/lib/python/site-packages/scapy/ansmachine.py", line 20, in
from scapy.sendrecv import send, sniff
ImportError: cannot import name 'send' from partially initialized module 'scapy.sendrecv' (most likely due to a circular import) (/Users/hq/Library/Python/3.8/lib/python/site-packages/scapy/sendrecv.py)
下载最新的scapy包,到自己类库中
git clone https://github.com/secdev/scapy.git
cd scapy
cp -r scapy ~/Library/Python/2.7/lib/python/site-packages/
运行环境使用python2.7