diff --git a/mujoco_py/builder.py b/mujoco_py/builder.py index c2d5b727..81f11981 100644 --- a/mujoco_py/builder.py +++ b/mujoco_py/builder.py @@ -84,7 +84,8 @@ def load_cython_ext(mujoco_path): builder = Builder(mujoco_path) cext_so_path = builder.get_so_file_path() - lockpath = os.path.join(os.path.dirname(cext_so_path), 'mujocopy-buildlock') + cext_so_hash = hash(os.path.dirname(cext_so_path)) + lockpath = os.path.join("/tmp", f"{cext_so_hash}-mujocopy-buildlock") with fasteners.InterProcessLock(lockpath): mod = None