snake.ai
snake.ai copied to clipboard
ImportError: No module named hp
I'm using Anaconda on Windows and when I run python contoller.py
, after installing all the packages, I'm getting this:
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "controller.py", line 167, in <module>
rl_hp = load_from(config.filename + ".p")
File "controller.py", line 57, in load_from
out = pickle.load(fin)
File "C:\Users\mcram\Anaconda3\envs\snake27\lib\pickle.py", line 1384, in load
return Unpickler(file).load()
File "C:\Users\mcram\Anaconda3\envs\snake27\lib\pickle.py", line 864, in load
dispatch[key](self)
File "C:\Users\mcram\Anaconda3\envs\snake27\lib\pickle.py", line 1075, in load_inst
klass = self.find_class(module, name)
File "C:\Users\mcram\Anaconda3\envs\snake27\lib\pickle.py", line 1130, in find_class
__import__(module)
ImportError: No module named hp
Any suggestions? Thank you.
I got the reply on Stack Overflow: https://stackoverflow.com/q/56412328/852795. In hp.py
I changed with open("data/" + filename, "rb") as fin:
to with open("data/" + filename, "r") as fin:
and it works!