class_docstr: LocalModuleManager is used to manage PaddleHub's local Module, which supports the installation, uninstallation,
  and search of HubModule. LocalModuleManager is a singleton object related to the path, in other words, when the
  LocalModuleManager object of the same home directory is generated multiple times, the same object is returned.
  
  Args:
      home (str): The directory where PaddleHub modules are stored, the default is ~/.paddlehub/modules
class_docstr_tok: ["LocalModuleManager","is","used","to","manage","PaddleHub","'s","local","Module",",","which","supports","the","installation",",","uninstallation",",","and","search","of","HubModule",".","LocalModuleManager","is","a","singleton","object","related","to","the","path",",","in","other","words",",","when","the","LocalModuleManager","object","of","the","same","home","directory","is","generated","multiple","times",",","the","same","object","is","returned",".","Args",":","home","(","str",")",":","The","directory","where","PaddleHub","modules","are","stored",",","the","default","is","~\/.paddlehub\/modules"]
docstr: Install HubModule by name search result
docstr_tok: ["Install","HubModule","by","name","search","result"]
code: def _install_from_name(
      self,
      name: str,
      version: str = None,
      ignore_env_mismatch: bool = False,
  ) -> HubModule:
      """Install HubModule by name search result"""
      result = module_server.search_module(name=name, version=version)
      for item in result:
          if name.lower() == item["name"].lower() and utils.Version(
              item["version"]
          ).match(version):
              return self._install_from_url(item["url"])
  
      module_infos = module_server.get_module_compat_info(name=name)
      # The HubModule with the specified name cannot be found
      if not module_infos:
          raise HubModuleNotFoundError(name=name, version=version)
  
      valid_infos = {}
      if version:
          for _ver, _info in module_infos.items():
              if utils.Version(_ver).match(version):
                  valid_infos[_ver] = _info
      else:
          valid_infos = module_infos.copy()
  
      # Cannot find a HubModule that meets the version
      if valid_infos:
          if not ignore_env_mismatch:
              raise EnvironmentMismatchError(
                  name=name, info=valid_infos, version=version
              )
  
          # If `ignore_env_mismatch` is set, ignore the problem of environmental mismatch, such as PaddlePaddle or PaddleHub
          # version incompatibility. This may cause some unexpected problems during installation or running, but it is useful
          # in some cases, for example, the development version of PaddlePaddle(with version number `0.0.0`) is installed
          # locally.
          if version:
              if version in valid_infos:
                  url = valid_infos[version]["url"]
              else:
                  raise HubModuleNotFoundError(
                      name=name, info=module_infos, version=version
                  )
          else:
              # Get the maximum version number.
              version = sorted(
                  [utils.Version(_v) for _v in valid_infos.keys()]
              )[-1]
              url = valid_infos[str(version)]["url"]
          log.logger.warning(
              "Ignore environmental mismatch of The Module {}-{}".format(
                  name, version
              )
          )
          return self._install_from_url(url)
      raise HubModuleNotFoundError(
          name=name, info=module_infos, version=version
      )
  
imports: import os
  import shutil
  import sys
  from collections import OrderedDict
  from typing import List
  import filelock
  from paddlehub.env import MODULE_HOME, TMP_HOME
  from paddlehub.module.module import Module
  from paddlehub.server import module_server
  from paddlehub.utils import xarfile, log, utils, pypi
label_desc: Use image node_id 10 for calling the LocalModuleManager obj's underlying member method code with example usage: obj._install_from_name(name, version, ignore_env_mismatch) and returns: self, self