今天我遇到了這個錯誤,如今將錯誤總結以下:html
1.首先查詢一下本身的操做系統,pexpect中的spawn()和run()僅僅運行在POSIX系統上,在WINDOWS下是沒有這兩個東西的,在官網http://pexpect.readthedocs.org/en/stable/install.html你能夠看到requirement裏面有一句話As of version 4.0, Pexpect can be used on Windows and POSIX systems. However, pexpect.spawn
andpexpect.run()
are only available on POSIXapi
2.stackoverflow有人遇到了這個問題,他的解決辦法是引入pexpect腳本copy到你本身的工做目錄,解決連接https://www.baidu.com/s?wd=pexpect%20have%20no%20attribute%27spawn%27&rsv_spt=1&rsv_iqid=0xa3aa9c5300066da4&issp=1&f=8&rsv_bp=0&rsv_idx=2&ie=utf-8&tn=baiduhome_pg&rsv_enter=1&rsv_sug3=34&rsv_sug1=14&rsv_sug2=0&inputT=14578&rsv_sug4=16422&rsv_sug=1
ui
有時候細節決定成敗,加油。spa