'Read local configuration file into google colab (Python)

Load NEAT config file

Unable to call upon a local file on google colab (first time using this). I uploaded the file but unable to call the information from the desired configuration file. Any pointers? Thanks.

local_dir = os.path.dirname(__file__)
config_path = os.path.join(local_dir, 'cartpole.config')
config = neat.Config(neat.DefaultGenome, neat.DefaultReproduction,
                    neat.DefaultSpeciesSet, neat.DefaultStagnation,
                    config_path)
population = neat.Population(config)
NameError: name '__file__' is not defined


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source