i have installed 开发者_C百科pexpect with the following command "python setup.py install" but when i try to run a program it says "AttributeError: 'module' object has no attribute 'spawn'". how to settle the matter?
It looks like pexpect wasn't ported yet to python 3 (quite a late answer, but still usable for people googling here)
Pexpect has not been ported to python3, and apparently the author has no plans on doing so. I tried converting it with the python 2to3 program, but could not get it to work.
Pexpect does support Python3 according to Pypi.
What is your OS? If Windows, then you should use pexpect.popen_spawn.PopenSpawn
instead.
More details here: https://pexpect.readthedocs.io/en/stable/overview.html#pexpect-on-windows
精彩评论