Gym: cannot import name spaces

Created on 26 Jan 2018  路  10Comments  路  Source: openai/gym

Hi, I recently installed gym package and I get following error whenever I try to import gym :
gy

stale

Most helpful comment

Doesn't seem to work for me. i downgraded gym to 0.9.2 to make it work.

All 10 comments

Do

pip uninstall gym
pip2 install gym
The error disappeared for me when I did that

Doesn't seem to work for me. i downgraded gym to 0.9.2 to make it work.

I got the same error when I tried to run one of their inbuilt examples /gym/examples/agents/random_agent.py after installing it.

Traceback (most recent call last):
File "random_agent.py", line 4, in <module>
import gym
File "/home/astronirav/git/gym/gym/__init__.py", line 12, in <module>
from gym import wrappers, spaces, logger
File "/home/astronirav/git/gym/gym/spaces/__init__.py", line 1, in <module>
from gym.spaces.box import Box
File "/home/astronirav/git/gym/gym/spaces/box.py", line 2, in <module>
from gym import Space, spaces, logger
ImportError: cannot import name 'spaces'

Got the same error.
Traceback (most recent call last): File "/Users/slava/Documents/Dev/IntroML/Labs/Lab11/main.py", line 1, in <module> import gym File "/Users/slava/Documents/Dev/openai/gym/gym/__init__.py", line 12, in <module> from gym import wrappers, spaces, logger File "/Users/slava/Documents/Dev/openai/gym/gym/spaces/__init__.py", line 1, in <module> from gym.spaces.box import Box File "/Users/slava/Documents/Dev/openai/gym/gym/spaces/box.py", line 2, in <module> from gym import Space, spaces, logger ImportError: cannot import name spaces

I am having the same problem. Downgrading to 0.9.5 fixes the problem for me

This PR solved the issue for me: https://github.com/openai/gym/pull/851

degrade is a nice sultion

Downgrade to 0.9.5 fixes for me as well.

I am getting this problem as well. I have gym 0.10.9 and want to downgrade this package. How do you downgrade to 0.9.5 or 0.9.2?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lbbc1117 picture lbbc1117  路  3Comments

pickittwice picture pickittwice  路  4Comments

RuofanKong picture RuofanKong  路  4Comments

tornadomeet picture tornadomeet  路  4Comments

RuofanKong picture RuofanKong  路  4Comments