pexpect 'module' object has no attribute 'spawn'

简介:

pexpect 'module' object has no attribute 'spawn'


solutions:


 found some similar info in the google, advice was to move .py file to another folder. It didn't work for me. Another advice was to delete " pycache" folder (I've got same in my pexpect.py location), but it didn't work aswell. Errors are still the same, this folder are still created after running the script (trying, I mean). Any ideas?



You have called your file pexpect.pyYou need to rename it to something else as you are importing from your file not the pexpect module. You also need to delete any .pyc in the same folder. It does not matter where you move your script, the current folder is still going to be in the path before where the actual pexpect module is.


本文转自aaa超超aaa 51CTO博客,原文链接:http://blog.51cto.com/10983441/1880497

相关文章
|
1月前
|
计算机视觉 Python
解决 NoneType‘ object has no attribute ‘astype’ 问题
解决 NoneType‘ object has no attribute ‘astype’ 问题
30 0
|
5月前
|
存储 JSON 数据格式
数据集加载时报错'dict' object has no attribute 'requests‘
数据集加载时报错'dict' object has no attribute 'requests‘
107 5
|
3月前
AttributeError: 'NoneType' object has no attribute 'to_capabilities'
AttributeError: 'NoneType' object has no attribute 'to_capabilities'
365 0
|
6月前
|
Python Windows
xlrd库报错【AttributeError: ‘ElementTree‘ object has no attribute ‘getiterator‘】
xlrd库报错【AttributeError: ‘ElementTree‘ object has no attribute ‘getiterator‘】
117 0
|
3月前
AttributeError ‘NoneType‘ object has no attribute ‘to_capabilities‘
AttributeError ‘NoneType‘ object has no attribute ‘to_capabilities‘
92 0
|
4月前
|
数据采集
运行爬虫时报错AttributeError—— 'str' object has no attribute 'capabilities'
运行爬虫时报错AttributeError—— 'str' object has no attribute 'capabilities'
246 0
|
4月前
'WebDriver' object has no attribute 'find_element_by_tag_name'
'WebDriver' object has no attribute 'find_element_by_tag_name'
118 0
|
8月前
yolov7—tensorrt报错AttributeError: ‘NoneType‘ object has no attribute ‘execute_v2‘已解决。
yolov7—tensorrt报错AttributeError: ‘NoneType‘ object has no attribute ‘execute_v2‘已解决。
86 0
yolov7—tensorrt报错AttributeError: ‘NoneType‘ object has no attribute ‘execute_v2‘已解决。
|
8月前
|
PyTorch 算法框架/工具
已解决虚拟机yolov5报错:AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
已解决虚拟机yolov5报错:AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'
213 0
已解决虚拟机yolov5报错:AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
|
8月前
|
Python
AttributeError: 'dict' object has no attribute 'has_key'
AttributeError: 'dict' object has no attribute 'has_key'