ArduPilot / SiK

Tools and firmware for the Si1000
BSD 2-Clause "Simplified" License
286 stars 232 forks source link

Error import fdpexpect in some files in the folder Firmware/tools/ #47

Open luisan00 opened 6 years ago

luisan00 commented 6 years ago

System Ubuntu 18.04 4.15.0-33-generic Executing some python scripts in /Firmware/tools/ appears the next error:

Traceback (most recent call last): File "./show_regs.py", line 4, in <module> import serial, sys, optparse, time, fdpexpect ImportError: No module named fdpexpect This error can be avoided changing: import fdpexpect by: from pexpect import fdpexpect

akissu commented 5 years ago

Using the latest pexpect PIP package for python2.7, and using from pexpect import fdpexpect import, returns the following error for me.

Connecting (use ^] to exit)                                                      
Traceback (most recent call last):                                               
  File "Firmware/tools/console.py", line 28, in <module>                          
    ser.interact()                                                               
AttributeError: 'fdspawn' object has no attribute 'interact' 

I can get things working by installing a pre 3.0 version of the package pip install "pexpect<3". The reality is that the python tools haven't been updated since 2012 and pexpect has been refactored a lot.