docstr: Runs the command.
docstr_tok: ["Runs","the","command","."]
code: def run(self):
      """Runs the command."""
      # Obviously have to build before we can install
      if not self.skip_build:
          self.run_command("build")
          # If we built for any other platform, we can't install.
          build_plat = self.distribution.get_command_obj(
              "build"
          ).plat_name
          # check warn_dir - it is a clue that the 'install' is happening
          # internally, and not to sys.path, so we don't check the platform
          # matches what we are running.
          if self.warn_dir and build_plat != get_platform():
              raise DistutilsPlatformError(
                  "Can't install when " "cross-compiling"
              )
  
      # Run all sub-commands (at least those that need to be run)
      for cmd_name in self.get_sub_commands():
          self.run_command(cmd_name)
  
      if self.path_file:
          self.create_path_file()
  
      # write list of installed files, if requested.
      if self.record:
          outputs = self.get_outputs()
          if self.root:  # strip any package prefix
              root_len = len(self.root)
              for counter in range(len(outputs)):
                  outputs[counter] = outputs[counter][root_len:]
          self.execute(
              write_file,
              (self.record, outputs),
              "writing list of installed files to '%s'" % self.record,
          )
  
      sys_path = map(os.path.normpath, sys.path)
      sys_path = map(os.path.normcase, sys_path)
      install_lib = os.path.normcase(os.path.normpath(self.install_lib))
      if (
          self.warn_dir
          and not (self.path_file and self.install_path_file)
          and install_lib not in sys_path
      ):
          log.debug(
              (
                  "modules installed to '%s', which is not in "
                  "Python's module search path (sys.path) -- "
                  "you'll have to change the search path yourself"
              ),
              self.install_lib,
          )
  
imports: import sys
  import os
  import contextlib
  import sysconfig
  import itertools
  from distutils._log import log
  from ..core import Command
  from ..debug import DEBUG
  from ..sysconfig import get_config_vars
  from ..file_util import write_file
  from ..util import convert_path, subst_vars, change_root
  from ..util import get_platform
  from ..errors import DistutilsOptionError, DistutilsPlatformError
  from .None import _framework_compat
  from ..None import _collections
  from site import USER_BASE
  from site import USER_SITE
label_desc: Use image node_id 14 for calling the install obj's underlying member method code with example usage: obj.run() without return types