def METHOD_NAME(megapose_env: str) -> Union[Path, None]:
  env_data = str(subprocess.check_output('conda info --envs', shell=True).decode())
  env_lines = env_data.split('\n')
  megapose_env_line = [line for line in env_lines if line.startswith(megapose_env)]
  assert(len(megapose_env_line) <= 1, 'Found multiple environment names with same name, this should not happen')
  if len(megapose_env_line) == 0:
    return None
  megapose_env_line = megapose_env_line[0]
  megapose_env_path = Path(megapose_env_line.split()[-1]).absolute()
  assert(megapose_env_path.exists())
  return megapose_env_path