我用了
>>>pip3 install scapy-python3已经成功安装了scapy模块
>>>import scapy 能行
但是
>>>from scapy.all import * 就会报错:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Mr.zhanglongqi\AppData\Local\Programs\Python\Python36\lib\site-
packages\scapy\all.py", line 16, in <module>
from .arch import *
File "C:\Users\Mr.zhanglongqi\AppData\Local\Programs\Python\Python36\lib\site-
packages\scapy\arch\__init__.py", line 95, in <module>
from .windows import *
File "C:\Users\Mr.zhanglongqi\AppData\Local\Programs\Python\Python36\lib\site-
packages\scapy\arch\windows\__init__.py", line 200, in <module>
ifaces.load_from_powershell()
File "C:\Users\Mr.zhanglongqi\AppData\Local\Programs\Python\Python36\lib\site-
packages\scapy\arch\windows\__init__.py", line 151, in load_from_powershell
for i in get_windows_if_list():
File "C:\Users\Mr.zhanglongqi\AppData\Local\Programs\Python\Python36\lib\site-
packages\scapy\arch\windows\__init__.py", line 77, in get_windows_if_list
ps = sp.Popen(['powershell', '-NoProfile', 'Get-WMIObject -class Win32_Netwo
rkAdapter', '|', 'select Name, @{Name="InterfaceIndex";Expression={$_.InterfaceI
ndex}}, @{Name="InterfaceDescription";Expression={$_.Description}},@{Name="Inter
faceGuid";Expression={$_.GUID}}, @{Name="MacAddress";Expression={$_.MacAddress.R
eplace(":","-")}} | where InterfaceGuid -ne $null', '|', 'fl'], stdout = sp.PIPE
, universal_newlines = True)
File "C:\Users\Mr.zhanglongqi\AppData\Local\Programs\Python\Python36\lib\subpr
ocess.py", line 707, in __init__
restore_signals, start_new_session)
File "C:\Users\Mr.zhanglongqi\AppData\Local\Programs\Python\Python36\lib\subpr
ocess.py", line 992, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
不知道为什么,捣腾了老半天了,还是没能解决,不知道坛内有木有人遇到过