crowdAI / marLo

Multi Agent Reinforcement Learning using MalmÖ
MIT License
244 stars 46 forks source link

Added explicit import for gym.spaces #61

Closed N2D4 closed 5 years ago

N2D4 commented 5 years ago

See https://github.com/openai/gym/issues/376

Unless you import it explicitly (either directly or by eg. calling gym.make), gym.spaces will not be added to the local scope of gym. Below an error log that can be reproduced by running the single_agent.py example with no prior calls to any libraries (macOS Mojave, gym 0.10.8, Python 3.6.6, conda 4.5.11):


  File "server.py", line 11, in <module>
    "client_pool": client_pool
  File "/anaconda3/envs/malmo_n/lib/python3.6/site-packages/marlo/__init__.py", line 96, in make
    join_tokens = env.init(params, dry_run=True)
  File "/anaconda3/envs/malmo_n/lib/python3.6/site-packages/marlo/base_env_builder.py", line 598, in init
    self.build_env(self.params)
  File "/anaconda3/envs/malmo_n/lib/python3.6/site-packages/marlo/base_env_builder.py", line 622, in build_env
    self.setup_observation_space(params)
  File "/anaconda3/envs/malmo_n/lib/python3.6/site-packages/marlo/base_env_builder.py", line 370, in setup_observation_space
    self.observation_space = gym.spaces.Box(
AttributeError: module 'gym' has no attribute 'spaces'```
spMohanty commented 5 years ago

Merged, thanks @N2D4 !