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 2020-04-01 11:21:48 +02:00 committed by Nuno Marques
parent baa50a1985
commit 07d172dc9c

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."