0

I'm having problems with neat-python version 0.92 and python version 3.9.5 (64 bit) on visual studio code. I keep getting the error: AttributeError: module 'neat' has no attribute 'Config'

The error comes from

def run(config_file):
    # Load the config file, which is assumed to live in
    # the same directory as this script.
    config = neat.Config(neat.DefaultGenome, neat.DefaultReproduction,
                         neat.DefaultSpeciesSet, neat.DefaultStagnation,
                         config_file)

    pop = neat.Population(config)
    stats = neat.StatisticsReporter()
    pop.add_reporter(stats)
    pop.add_reporter(neat.StdOutReporter(True))

    pe = neat.ParallelEvaluator(multiprocessing.cpu_count(), eval_genome)
    winner = pop.run(pe.evaluate)

    # Save the winner.
    with open('winner', 'wb') as f:
        pickle.dump(winner, f)

    print(winner)


if __name__ == '__main__':
    local_dir = os.path.dirname(__file__)
    config_path = os.path.join(local_dir, 'config-feedforward')
    run(config_path)

More specifically:

config = neat.Config(neat.DefaultGenome, neat.DefaultReproduction,
                         neat.DefaultSpeciesSet, neat.DefaultStagnation,
                         config_file)

I have tried reinstalling neat-python and I don't run just neat which was answered in another issue.

ShadowRanger
  • 143,180
  • 12
  • 188
  • 271
Fantomet
  • 64
  • 6
  • Does this answer your question? [How to fix: AttributeError: module 'neat' has no attribute 'config'](https://stackoverflow.com/questions/58574696/how-to-fix-attributeerror-module-neat-has-no-attribute-config) – Tharun K Apr 12 '22 at 13:33
  • @TharunK no, im running correct neat and I did check the source code of my install and everything seemed fine – Fantomet Apr 12 '22 at 13:36
  • 1
    Please don't edit your question to say it's solved. Either: 1) If the answer is unlikely to be useful to others, delete the question, or 2) Post your own answer as an answer. – ShadowRanger Apr 12 '22 at 17:21
  • 1
    You can (and should) add your solution as an "answer" to the question and then mark it as accepted. The "Solved:" in the question convention is not used on SO. – Noufal Ibrahim Apr 12 '22 at 17:21
  • Didn't know this, i posted my answer and will accept it whenever i can! – Fantomet Apr 12 '22 at 18:59

1 Answers1

0

I uninstalled neat-python using pip uninstall neat-python then reinstalled it manually using the source code on github

Fantomet
  • 64
  • 6