code: def require(packages):
      
      global INSTALLED_PACKAGES, _new_requirements
  
      if _new_requirements:
          INSTALLED_PACKAGES = None
  
      set_installed_packages()
      if not INSTALLED_PACKAGES:
          return
  
      if not isinstance(packages, list):
          packages = [packages]
  
      missing = []
      for package in packages:
          name = re.split(r'[!<>=]', package)[0].lower()
          if name not in INSTALLED_PACKAGES:
              print(ansi.info() + ' %s is required.' % package)
              missing += [package]
  
      if missing:
          mode = 'a' if os.path.exists(REQUIREMENTS) else 'w'
          with open(REQUIREMENTS, mode) as requirements:
              requirements.write('\n' + '\n'.join(missing) + '\n')
          print(ansi.info() + ' Dependencies added to requirements.txt. Rebooting.')
          _new_requirements = True
          import lore.__main__
          lore.__main__.install(None, None)
          reboot('--env-checked')
docs: Ensures that a pypi package has been installed into the App's python environment.
      If not, the package will be installed and your env will be rebooted.
  
      Example:
          ::
  
              lore.env.require('pandas')
              # -> pandas is required. Dependencies added to requirements.txt
  
      :param packages: requirements.txt style name and versions of packages
      :type packages: [unicode]