diff --git a/Tools/px_uploader.py b/Tools/px_uploader.py index 2782c91430cc9fee46b731143655c203d7e9cfbb..6ea4432890a6e1d854b20b81471ac1d574505c56 100755 --- a/Tools/px_uploader.py +++ b/Tools/px_uploader.py @@ -732,6 +732,16 @@ def main(): print("WARNING: You should uninstall ModemManager as it conflicts with any non-modem serial device (like Pixhawk)") print("==========================================================================================================") + # We need to check for pyserial because the import itself doesn't + # seem to fail, at least not on macOS. + try: + if serial.__version__: + pass + except: + print("Error: pyserial not installed!") + print(" (Install using: sudo pip install pyserial)") + sys.exit(1) + # Load the firmware file fw = firmware(args.firmware)