tools: present nicer error for missing packaging

This makes the error more user friendly and suggests what to do to fix
it.
This commit is contained in:
Julian Oes authored and Nuno Marques committed 2020-04-01 10:42:18 +01:00
1 parent baa50a1985
commit 07d172dc9c
1 file changed
+10 -1
+10 -1
View File
@@ -43,7 +43,6 @@ import shutil
import filecmp
import argparse
import sys
from packaging import version
try:
import em
@@ -65,6 +64,16 @@ except ImportError as e:
print("")
sys.exit(1)
try:
from packaging import version
except ImportError as e:
print("Failed to import packaging: " + str(e))
print("")
print("You may need to install it using:")
print(" pip3 install --user packaging")
print("")
sys.exit(1)
__author__ = "Sergey Belash, Thomas Gubler, Beat Kueng"
__copyright__ = "Copyright (C) 2013-2016 PX4 Development Team."