<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def open_window(path):
 """Open path in finder or explorer window"""

    if 'pathlib' in modules:
        try:
            call(["open", "-R", str(Path(str(path)))])
        except FileNotFoundError:
            Popen(r'explorer /select,' + str(Path(str(path))))
    else:
        print('pathlib module must be installed to execute open_window function')