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.py. You 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.