mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 18:06:39 +08:00
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:
@@ -43,7 +43,6 @@ import shutil
|
|||||||
import filecmp
|
import filecmp
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
from packaging import version
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import em
|
import em
|
||||||
@@ -65,6 +64,16 @@ except ImportError as e:
|
|||||||
print("")
|
print("")
|
||||||
sys.exit(1)
|
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"
|
__author__ = "Sergey Belash, Thomas Gubler, Beat Kueng"
|
||||||
__copyright__ = "Copyright (C) 2013-2016 PX4 Development Team."
|
__copyright__ = "Copyright (C) 2013-2016 PX4 Development Team."
|
||||||
|
|||||||
Reference in New Issue
Block a user