def generate_reqs(self):
        print(Color.BLUE('Starting generate requirements ...'))
        reqs, try_imports, guess = self.extract_reqs()
        in_pypi = set()
        answer = 'n'
        pyver = None

        guess.remove(*try_imports)
        if guess:
            print(Color.RED('The following modules are not found yet:'))
            self._invalid_reqs(guess)
            msg = ('Some of them may not install in local environment.\n'
                   'Try to search PyPI for the missing modules and filter'
                   ' some unnecessary modules? (y/[N]) '
                   ).format(pyver)
            sys.stdout.write(Color.RED(msg))
            sys.stdout.flush()
            answer = sys.stdin.readline()
            answer = answer.strip().lower()
            if answer in ('y', 'yes'):
                print(Color.BLUE('Checking modules on the PyPI...'))
                for name, detail in guess.sorted_items():
                    logger.info('Checking {0} on the PyPI ...'.format(name))
                    with database() as db:
                        rows = db.query_all(name)
                        pkgs = [row.package for row in rows]
                        if pkgs:
                            in_pypi.add(name)
                            if name in self._maybe_local_mods:
                                self._maybe_local_mods.remove(name)
                        for pkg in self._best_matchs(name, pkgs):
                            latest = check_latest_version(pkg)
                            reqs.add(pkg, latest, detail.comments)

        # Save old requirements file.
        self._save_old_reqs()
        # Write requirements to file.
        self._write_reqs(reqs)
        # If requirements has been covered, show difference.
        self._reqs_diff()
        print(Color.BLUE('Generate requirements done!'))
        del reqs

        if guess and answer in ('y', 'yes'):
            guess.remove(*(in_pypi | self._maybe_local_mods))
            if guess:
                print(Color.RED('These modules are not found:'))
                self._invalid_reqs(guess)
                print(Color.RED('Maybe or you need update database.'))
Generate requirements for `project_path`, save file in
dataset/ETHPy150Open Damnever/pigar/pigar/__main__.py/GenerateReqs.generate_reqs