diff --git a/examples/tutorial_api_python/1_body_from_image.py b/examples/tutorial_api_python/1_body_from_image.py index c0b9ae2a01933254665aa10e9eade2d1169646e5..f89225f4a6e0a263894c157f60f94684bfcc20cc 100644 --- a/examples/tutorial_api_python/1_body_from_image.py +++ b/examples/tutorial_api_python/1_body_from_image.py @@ -21,8 +21,9 @@ try: # If you run `make install` (default path is `/usr/local/python` for Ubuntu), you can also access the OpenPose/python module from there. This will install OpenPose and the python library at your desired installation path. Ensure that this is in your python path in order to use it. # sys.path.append('/usr/local/python') from openpose import pyopenpose as op -except: - raise Exception('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?') +except ImportError as e: + print('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?') + raise e # Flags parser = argparse.ArgumentParser() diff --git a/examples/tutorial_api_python/2_whole_body_from_image.py b/examples/tutorial_api_python/2_whole_body_from_image.py index b43a56ed9b6dcb2636911fe39c15ac741872db94..fbf7f8a617973a84be90bd9ec90f216d8ed4a47e 100644 --- a/examples/tutorial_api_python/2_whole_body_from_image.py +++ b/examples/tutorial_api_python/2_whole_body_from_image.py @@ -21,8 +21,9 @@ try: # If you run `make install` (default path is `/usr/local/python` for Ubuntu), you can also access the OpenPose/python module from there. This will install OpenPose and the python library at your desired installation path. Ensure that this is in your python path in order to use it. # sys.path.append('/usr/local/python') from openpose import pyopenpose as op -except: - raise Exception('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?') +except ImportError as e: + print('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?') + raise e # Flags parser = argparse.ArgumentParser() diff --git a/examples/tutorial_api_python/3_heatmaps_from_image.py b/examples/tutorial_api_python/3_heatmaps_from_image.py index 79d9b381c9890855f97258843f6e69b24faeba3d..0d16812d2608c5c27ad7791ac587ca5455d7b64a 100644 --- a/examples/tutorial_api_python/3_heatmaps_from_image.py +++ b/examples/tutorial_api_python/3_heatmaps_from_image.py @@ -22,8 +22,9 @@ try: # If you run `make install` (default path is `/usr/local/python` for Ubuntu), you can also access the OpenPose/python module from there. This will install OpenPose and the python library at your desired installation path. Ensure that this is in your python path in order to use it. # sys.path.append('/usr/local/python') from openpose import pyopenpose as op -except: - raise Exception('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?') +except ImportError as e: + print('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?') + raise e # Flags parser = argparse.ArgumentParser() diff --git a/examples/tutorial_api_python/openpose_python.py b/examples/tutorial_api_python/openpose_python.py index 70a66be2604bebd5416a996e5c43c0a53489a147..9d2f0a3b010d163d4a71b54fab8989903463d0e1 100644 --- a/examples/tutorial_api_python/openpose_python.py +++ b/examples/tutorial_api_python/openpose_python.py @@ -21,8 +21,9 @@ try: # If you run `make install` (default path is `/usr/local/python` for Ubuntu), you can also access the OpenPose/python module from there. This will install OpenPose and the python library at your desired installation path. Ensure that this is in your python path in order to use it. # sys.path.append('/usr/local/python') from openpose import pyopenpose as op -except: - raise Exception('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?') +except ImportError as e: + print('Error: OpenPose library could not be found. Did you enable `BUILD_PYTHON` in CMake and have this Python script in the right folder?') + raise e # Flags parser = argparse.ArgumentParser()