我正在尝试在 python 3.6 中使用 scapy 来解析 pcap 文件,而我正在尝试使用的功能是 pdfdump。
from scapy.all import *
packets = rdpcap('***path***/nitroba.pcap')
for packet in packets[0:1]:
packet.psdump("isakmp_pkt.eps",layer_shift=1)
我收到以下错误:“ImportError: PyX and its depedencies must be installed”
显然我安装了它,并且一个简单的“import pyx”可以工作,但错误仍然存在。我做了一些挖掘,发现问题出在这段代码中:
def _test_pyx():
"""Returns if PyX is correctly installed or not"""
try:
with open(os.devnull, 'wb') as devnull:
r = subprocess.check_call(["pdflatex", "--version"], stdout=devnull, stderr=subprocess.STDOUT)
except:
return False
else:
return r == 0
执行时,它会确定 pyx 是否安装正确,但会显示“FileNotFoundError: [WinError 2] The system cannot find the file specified”。
想法?