简体   繁体   English

Python:AttributeError:'module'对象没有属性'socketpair'

[英]Python: AttributeError: 'module' object has no attribute 'socketpair'

I wanna try " socketpair " function in my "discovering and studying" python program language. 我想在我的“发现和学习”python程序语言中尝试“ socketpair ”功能。 Im creating socketpair with following command: 我使用以下命令创建socketpair:

import socket

parent, child = socket.socketpair()

and then I get error: Python: AttributeError: 'module' object has no attribute 'socketpair' 然后我得到错误: Python: AttributeError: 'module' object has no attribute 'socketpair'

Im working in eclipse, in windows. 我在日食,在窗户工作。 I suppouse socketpair working only in UNIX enviroment, but socket module should include socketpair anyway. 我支持socketpair仅在UNIX环境中工作,但socket模块应该包括socketpair

How should I fix it? 我该如何解决?

thanks 谢谢

Regards 问候

At the moment this is not available on Windows, but it is in development, as you can see in related bug . 目前这在Windows上不可用,但它正在开发中,正如您可以在相关的bug中看到的那样。

You can find workaround over the net, like here: http://code.activestate.com/recipes/525487-extending-socketsocketpair-to-work-on-windows/ 您可以通过网络找到解决方法,例如: http//code.activestate.com/recipes/525487-extending-socketsocketpair-to-work-on-windows/

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

相关问题 Python AttributeError:“模块”对象没有“连接”属性 - Python AttributeError: 'module' object has no attribute 'connect' Python:AttributeError:'module'对象没有属性'AddReference'? - Python: AttributeError: 'module' object has no attribute 'AddReference'? AttributeError:“模块”对象在python中没有属性“ windll” - AttributeError: 'module' object has no attribute 'windll' in python Python 2:AttributeError:“模块”对象没有属性“扫描” - Python 2: AttributeError: 'module' object has no attribute 'scan' Python:AttributeError:“模块”对象没有属性 - Python: AttributeError: 'module' object has no attribute Python:AttributeError:“模块”对象没有属性“附加” - Python: AttributeError: 'module' object has no attribute 'append' Python AttributeError:'module'对象没有属性'suite' - Python AttributeError: 'module' object has no attribute 'suite' AttributeError:'module'对象没有属性python - AttributeError: 'module' object has no attribute python Python AttributeError: 'module' object 没有属性 'init' - Python AttributeError: 'module' object has no attribute 'init' Python AttributeError:“模块”对象没有属性“获取” - Python AttributeError: 'module' object has no attribute 'get'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM