Question

I'm trying to run one of these tutorials and this is what I get:

$ python rl.py
Traceback (most recent call last):
  File "rl.py", line 22, in <module>
    from pybrain.rl.environments.mazes import Maze, MDPMazeTask
  File "/Library/Python/2.7/site-packages/PyBrain-0.3.1-py2.7.egg/pybrain/rl/environments/mazes/__init__.py", line 3, in <module>
    from pybrain.rl.environments.mazes.tasks.__init__ import *
  File "/Library/Python/2.7/site-packages/PyBrain-0.3.1-py2.7.egg/pybrain/rl/environments/mazes/tasks/__init__.py", line 1, in <module>
    from pybrain.rl.environments.mazes.tiger import TigerTask
ImportError: No module named tiger

It installed successfully, not sure why it can't load it's own modules?

Was it helpful?

Solution

You need to change file: pybrain/pybrain/rl/environments/mazes/tasks/__init__.py as:

from pybrain.rl.environments.mazes.tiger import TigerTask

to:

from pybrain.rl.environments.mazes.tasks.tiger import TigerTask

OTHER TIPS

Actually, as suggested here, you should change the whole pybrain/pybrain/rl/environments/mazes/tasks/init.py as follows:

from pybrain.rl.environments.mazes.tasks.tiger import TigerTask
from pybrain.rl.environments.mazes.tasks.maze import TrivialMaze, MazeTask
from pybrain.rl.environments.mazes.tasks.cheesemaze import CheeseMaze
from pybrain.rl.environments.mazes.tasks.tmaze import TMaze
from pybrain.rl.environments.mazes.tasks.maze4x3 import FourByThreeMaze
from pybrain.rl.environments.mazes.tasks.maze89state import EightyNineStateMaze
from pybrain.rl.environments.mazes.tasks.shuttle import ShuttleDocking
from pybrain.rl.environments.mazes.tasks.mdp import MDPMazeTask

check pybrain.rl.environments.__file__ to get the path to the file. This solved the importing problem for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top