diff --git a/virtualhome/__init__.py b/virtualhome/__init__.py index 184ac266d..2fdf92a14 100644 --- a/virtualhome/__init__.py +++ b/virtualhome/__init__.py @@ -7,5 +7,12 @@ new_path = original_path + '/virtualhome/simulation' sys.path.append(new_path) -from unity_simulator.comm_unity import UnityCommunication -from unity_simulator import utils_viz \ No newline at end of file +# if installed via pip +try: + from unity_simulator.comm_unity import UnityCommunication + from unity_simulator import utils_viz + +# if running locally (cloned into the project repository) +except ModuleNotFoundError: + from .simulation.unity_simulator.comm_unity import UnityCommunication + from .simulation.unity_simulator import utils_viz