python报错:AttributeError: module 'socket' has no attribute 'error'
报错:
AttributeError: module 'socket' has no attribute 'error'
处理方案:
若出现此报错,只有一种可能性就是,你有文件夹或者文件名命名为socket
原因:python 导入模块的顺序是先找当前目录, 然后在找环境变量里面配置的 ,当前目录下只要是.py 或者.pyc 文件都是优先导入当前目录下面的。