There is an error in the import 도와 Please help me!

Asked 2 years ago, Updated 2 years ago, 79 views

Input Code

from scapy.all import*

Error

File "sniffer0_with_scapy.py", line 1, in

from scapy.all import*

File "C:\python\lib\site-packages\scapy\all.py", line 16, in from .arch import * File "C:\python\lib\site-packages\scapy\arch_init.py", line 95, in from .windows import * File "C:\python\lib\site-packages\scapy\arch\windows__init.py", line 201, in ifaces.load_from_powershell() File "C:\python\lib\site-packages\scapy\arch\windows__init.py", line 152, in load_from_powershell for i in get_windows_if_list(): File "C:\python\lib\site-packages\scapy\arch\windows__init.py", line 78, in get_windows_if_list ps = sp.Popen(['powershell', '-NoProfile', 'Get-WMIObject -class Win32_NetworkAdapter', '|', 'select Name, @{Name="InterfaceIndex";Expression={$.Index}}, @{Name="InterfaceDescription";Expression={$.Description}},@{Name="InterfaceGuid";Expression={$.GUID}}, @{Name="MacAddress";Expression={$.MacAddress.Replace(":","-")}} | where InterfaceGuid -ne $null', '|', 'fl'], stdout = sp.PIPE, universal_newlines = True) File "C:\python\lib\subprocess.py", line 947, in __init_ restore_signals, start_new_session) File "C:\python\lib\subprocess.py", line 1224, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The specified file could not be found

I'm asking you this question because I keep getting errors when importing sky.allㅜㅜ You can also install a copy, so you can import it. Winpcap is also installed.

Help me! ㅜ<

scapy subprocess winerror2

2022-09-21 23:04

1 Answers

Scrapy version 1 and version 2 are different, so this problem occurs.

If you look at Scrapy doc,

In Scapy v2 use from scapy.all import * instead of from scapy import *.

That's what it says. I think Kim Hansoo is using Scapy version 1.

Use with from scan import * in version 1.


2022-09-21 23:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.