AttributeError: 'module' object has no attribute 'AF_INET'
来源:互联网 发布:洗盘和出货的区别知乎 编辑:程序博客网 时间:2024/05/16 10:44
今天在练习tcp编程时,碰到如下报错:
bogon:test test$ python socket.py
Traceback (most recent call last):
File "socket.py", line 4, in <module>
import socket
File "/socket.py", line 6, in <module>
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
AttributeError: 'module' object has no attribute 'AF_INET'
在参考如下链接后,
http://stackoverflow.com/questions/14755963/websocket-server-in-python-module-object-has-no-attribute-af-inet
发现问题:
看来您已经命名自己的文件socket.py,所以当你import socket,你没有得到系统库(它只是
重新导入文件,你目前在-它没有AF_INET符号)。尝试重命名文件类似mysocket.py。
0 0
- AttributeError: 'module' object has no attribute 'AF_INET'
- 对于AttributeError: ‘module’ object has no attribute ‘AF_INET
- AttributeError: 'module' object has no attribute 'getpass'
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'module' object has no attribute(转)
- AttributeError: 'module' object has no attribute 'randint'
- AttributeError: 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'module' object has no attribute 'LabelMap'
- AttributeError: 'module' object has no attribute 'XXX'
- AttributeError: 'module' object has no attribute 'urlopen'
- AttributeError:'module' object has no attribute 'classify'
- AttributeError: ‘module’ object has no attribute’xxx’
- AttributeError: ‘module’ object has no attribute’ 问题
- AttributeError: 'module' object has no attribute 'VideoWriter_fourcc'
- AttributeError: 'module' object has no attribute 'VideoWriter_fourcc'
- AttributeError: 'module' object has no attribute '_base'
- AttributeError: 'module' object has no attribute 'best_partition'
- C++函数的调用及函数原型
- tomcat 启动报错 org.apache.catalina.deploy.WebXml addFilter 解决
- shell 批量重命名
- 使用gdbserver+arm-linux-gdb 调试应用程序
- 在线考试系统源码
- AttributeError: 'module' object has no attribute 'AF_INET'
- NoClassDefFoundError: Failed resolution of: Landroid/support/v7/internal/widget/TintManager
- 文章标题
- vulkan中vertex buffer的用法
- 在页面超链接<a>前加上图标
- notes virtualbox User Manual
- App Key 和 App Secret 有什么用?
- Android中SwipeRefreshLayout的使用
- TogetherJs中文