简体   繁体   English

Scapy导入错误'socket.gaierror:[Errno 11001] getaddrinfo失败'

[英]Scapy import error 'socket.gaierror: [Errno 11001] getaddrinfo failed'

Im trying to install Scapy on windows 10, python 2.7.11, and stuck on this error: 我试图在Windows 10,python 2.7.11上安装Scapy,并停留在此错误上:

>>> from scapy.all import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\tools\python\lib\site-packages\scapy\all.py", line 25, in <module>
    from scapy.route import *
  File "C:\tools\python\lib\site-packages\scapy\route.py", line 182, in <module>
    _betteriface = conf.route.route("0.0.0.0", verbose=0)[0]
  File "C:\tools\python\lib\site-packages\scapy\route.py", line 150, in route
    aa = atol(a)
  File "C:\tools\python\lib\site-packages\scapy\utils.py", line 400, in atol
    except socket.error:
socket.gaierror: [Errno 11001] getaddrinfo failed

What does it mean? 这是什么意思?

As stated in the python 2.7 documentation , this error is thrown either by the getaddrinfo() or getnameinfo() function. python 2.7文档中所述 ,此错误由getaddrinfo()或getnameinfo()函数引发。
Judging by the stack trace, the scapy module tries to initialize a socket during its import and the port number is invalid (we can see the atol function being called, which convert a string to an integer). 从堆栈跟踪判断,scapy模块会在导入期间尝试初始化套接字,并且端口号无效(我们可以看到调用了atol函数,该函数将字符串转换为整数)。
It is unclear what the real issue is. 目前尚不清楚真正的问题是什么。 However, you can try the following things: 但是,您可以尝试以下操作:

  • Make sure you have the right version of python and scapy. 确保您具有正确版本的python和scapy。 I suggest that you install scapy from pip, and maybe use a virtual environment to run your script. 我建议您从pip安装scapy,并可能使用虚拟环境来运行脚本。
  • You can also try to compile scapy from source , or check the issue section in github to see if your problem is actually a known problem being worked on. 您也可以尝试从源代码编译scapy ,或者检查github中的issue部分,以查看您的问题是否实际上是正在解决的已知问题。
  • Maybe scapy tries to initialize a raw socket (i don't know why they would, but its worth a try), which requires admin privileges. 也许scapy尝试初始化一个原始套接字(我不知道为什么会这样,但是值得尝试),这需要管理员权限。 Try running your script as admin. 尝试以管理员身份运行脚本。

    Hope this helps 希望这可以帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 socket.gaierror:[Errno 11001] getaddrinfo 失败 - socket.gaierror: [Errno 11001] getaddrinfo failed 错误:- socket.gaierror:[Errno 11001] getaddrinfo 在获取请求中失败 - Error :- socket.gaierror: [Errno 11001] getaddrinfo failed in get request (Python)socket.gaierror:[Errno 11001] getaddrinfo失败 - (Python) socket.gaierror: [Errno 11001] getaddrinfo failed 如何解决:socket.gaierror: [Errno 11001] getaddrinfo failed - How to solve: socket.gaierror: [Errno 11001] getaddrinfo failed socket.gaierror: [Errno 11001] getaddrinfo 在 django 中失败 - socket.gaierror: [Errno 11001] getaddrinfo failed in django 当我在 python 中使用套接字模块时,我收到此错误:'socket.gaierror: [Errno 11001] getaddrinfo failed' - I get this error:' socket.gaierror: [Errno 11001] getaddrinfo failed' when I use the socket module in python 处理获取 socket.gaierror 的错误:[Errno 11001] getaddrinfo 在 Python 中使用 pyopenssl 失败 - Handling error for Getting a socket.gaierror: [Errno 11001] getaddrinfo failed using pyopenssl in Python gaierror socket.gaierror: [Errno 11001] getaddrinfo 失败 mail.send(msg) - gaierror socket.gaierror: [Errno 11001] getaddrinfo failed mail.send(msg) socket.gaierror:[Errno 11003] getaddrinfo失败 - socket.gaierror: [Errno 11003] getaddrinfo failed socket.gaierror: [Errno 11001] getaddrinfo failed" in python,同时使用简单的自定义 web 浏览器 - socket.gaierror: [Errno 11001] getaddrinfo failed" in python, while using a simple custom web browser
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM