Skip to content

Commit

Permalink
Changed behaviour when encountering import errors for easier debuggin…
Browse files Browse the repository at this point in the history
  • Loading branch information
gnastacast authored and gineshidalgo99 committed Jan 17, 2019
1 parent eb68890 commit ce6338f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions examples/tutorial_api_python/1_body_from_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
# 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()
Expand Down
5 changes: 3 additions & 2 deletions examples/tutorial_api_python/2_whole_body_from_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
# 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()
Expand Down
5 changes: 3 additions & 2 deletions examples/tutorial_api_python/3_heatmaps_from_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
# 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()
Expand Down
5 changes: 3 additions & 2 deletions examples/tutorial_api_python/openpose_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
# 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()
Expand Down

0 comments on commit ce6338f

Please sign in to comment.