code: def install_egg(self, egg_name):
          
          if not os.path.exists(self.egg_directory):
              os.makedirs(self.egg_directory)
          self.requirement_set.add_requirement(
              InstallRequirement.from_line(egg_name, None))
          try:
              self.requirement_set.prepare_files(self.finder)
              self.requirement_set.install(['--prefix=' + self.egg_directory], [])
          except DistributionNotFound:
              self.requirement_set.requirements._keys.remove(egg_name)
              raise PipException()
docs: Install an egg into the egg directory