1

I have some problems with the example of stable-baselines and look forward to your help.

The environment is set as:

Windows 10
spyder 3.6
tensorflow 1.4.0
gym 0.15.4
stable_baselines 2.8.0

However, I cannot import:

from stable_baselines.common import make_vec_env

The error is:

Traceback (most recent call last):

  File "<ipython-input-96-9dcb30379014>", line 1, in <module>
    from stable_baselines.common import make_vec_env

ImportError: cannot import name 'make_vec_env'
Jiaman Wu
  • 13
  • 5

1 Answers1

1

If this is the module we are talking about.

https://github.com/hill-a/stable-baselines

Seems like there was an issue that has been solved in 2.9.0:

https://github.com/araffin/rl-baselines-zoo/issues/51

Upgrade your stable-baselines:

pip install stable-baselines==2.9.0

And then it should be enough to use:

from stable_baselines.common.cmd_util import make_vec_env
sparaflAsh
  • 646
  • 1
  • 9
  • 26
  • 1
    I tried but get "Traceback (most recent call last): ImportError: cannot import name 'FlattenDictWrapper' " – Jiaman Wu Dec 18 '19 at 15:54
  • can you `pip freeze` in a shell and see which stable-baselines and gym you are using? If you add it to your question it will be easier to help. If you look in `cmd_util.py` you will see this import that it's failing. `from gym.wrappers import FlattenDictWrapper` – sparaflAsh Dec 18 '19 at 16:05