我对这个装置感到很疯狂,但似乎没什么用。
Python 3.5安装在:“C:\ Program Files(x86)\ Python35-32”下,因此中间有一个空格。
我以两种方式安装了scapy:
每次我尝试运行scapy终端但无济于事。 它返回以下错误:
python: can't open file 'C:\Program': [Errno 2] No such file or directory
尝试运行以下代码(想ping谷歌):
from scapy.all import sr1,IP,ICMP
p=sr1(IP(dst="8.8.8.8")/ICMP())
if p:
p.show()
但是得到以下错误:
WARNING: Windows support for scapy3k is currently in testing.
Sniffing/sending/receiving packets should be working with WinPcap driver and
Powershell. Create issues at https://github.com/phaethon/scapy
Traceback (most recent call last):
File "C:\Users\rads x\Desktop\FIX\connectivity.py", line 13, in
<module>
from scapy.all import sr1,IP,ICMP
File "C:\Program Files (x86)\Python35-32\lib\site-packages\scapy\all.py",
line 16, in <module>
from .arch import *
File "C:\Program Files (x86)\Python35-32\lib\site-
packages\scapy\arch\__init__.py", line 88, in <module>
from .windows import *
File "C:\Program Files (x86)\Python35-32\lib\site-
packages\scapy\arch\windows\__init__.py", line 23, in <module>
from scapy.arch import pcapdnet
File "C:\Program Files (x86)\Python35-32\lib\site-
packages\scapy\arch\pcapdnet.py", line 32, in <module>
from .winpcapy import *
File "C:\Program Files (x86)\Python35-32\lib\site-\
packages\scapy\arch\winpcapy.py", line 26, in <module>
_lib=CDLL('wpcap.dll')
File "C:\Program Files (x86)\Python35-32\lib\ctypes\__init__.py", line 347,
in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
答案 0 :(得分:1)
很老的帖子。
为了记录,官方secdev / scapy现在支持Python 3。 随意浏览他们的官方github页面: https://github.com/secdev/scapy
度过愉快的一周
答案 1 :(得分:0)
根据文档,由于缺少依赖性(Twisted),Windows 3上不支持使用scrapy。