具有scapy canty的pydev识别进口

时间:2013-07-18 02:44:06

标签: debugging import pydev scapy

所以我今天遇到了一个问题,scapy没有认出我的进口。这不是版本问题,因为我尝试了所有可能的python版本和两者:

  来自scapy import *

     

来自scapy.all import *

这个问题真的很烦人,所以任何帮助都会非常感激。目前我使用python 2.5与版本2.2 scapy。

以下是代码:

import logging
from scapy.layers.inet6 import IP
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import  *

i = IP()

以下是错误消息:

Traceback (most recent call last):
  File "C:\Users\Martinooos\Desktop\eclipse\plugins\org.python.pydev_2.7.5.2013052819\pysrc\pydev_runfiles.py", line 432, in __get_module_from_str
    mod = __import__(modname)
  File "C:\Users\Martinooos\workspace\testing\test.py", line 7, in <module>
    from scapy.layers.inet6 import IP
  File "C:\Users\Martinooos\Desktop\scapy-2.2.0\scapy\layers\inet6.py", line 35, in <module>
    from scapy.layers.l2 import *
  File "C:\Users\Martinooos\Desktop\scapy-2.2.0\scapy\layers\l2.py", line 14, in <module>
    from scapy.ansmachine import *
  File "C:\Users\Martinooos\Desktop\scapy-2.2.0\scapy\ansmachine.py", line 14, in <module>
    from sendrecv import send,sendp,sniff
  File "C:\Users\Martinooos\Desktop\scapy-2.2.0\scapy\sendrecv.py", line 13, in <module>
    import arch
  File "C:\Users\Martinooos\Desktop\scapy-2.2.0\scapy\arch\__init__.py", line 79, in <module>
    from windows import *
  File "C:\Users\Martinooos\Desktop\scapy-2.2.0\scapy\arch\windows\__init__.py", line 17, in <module>
    from scapy.sendrecv import srp1
ImportError: cannot import name srp1

注意:如果我从文件中删除srp1,则会弹出另一个导入错误,因此每次导入都会出现这种情况。由于pydev识别scapy文件夹,我不知道发生了什么。

任何人都可以帮助我吗? 感谢

1 个答案:

答案 0 :(得分:1)

确保订单正确。下面的代码工作正常。

import logging
from scapy.all import *
from scapy.layers.inet6 import IP
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

i = IP()