Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Importing Gym #1153

Closed
lhorus opened this issue Aug 30, 2018 · 2 comments
Closed

Error Importing Gym #1153

lhorus opened this issue Aug 30, 2018 · 2 comments

Comments

@lhorus
Copy link

lhorus commented Aug 30, 2018

I have tried creating my own gym, which is giving me an error. However, to ensure its my problem, I tried importing a regular gym, and the error remains. This is a simple import, nothing else.

Call Stack:
Traceback (most recent call last): File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\Lib\site-packages\gym\envs\test.py", line 1, in <module> import gym File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\lib\site-packages\gym\__init__.py", line 10, in <module> from gym.core import Env, GoalEnv, Space, Wrapper, ObservationWrapper, ActionWrapper, RewardWrapper File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\lib\site-packages\gym\core.py", line 2, in <module> import numpy as np File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\__init__.py", line 142, in <module> from . import add_newdocs File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\add_newdocs.py", line 13, in <module> from numpy.lib import add_newdoc File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\lib\__init__.py", line 8, in <module> from .type_check import * File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\lib\type_check.py", line 11, in <module> import numpy.core.numeric as _nx File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core\__init__.py", line 74, in <module> from numpy.testing import _numpy_tester File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\testing\__init__.py", line 10, in <module> from unittest import TestCase File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\Lib\site-packages\gym\envs\unittest\__init__.py", line 1, in <module> from gym.envs.unittest.cube_crash import CubeCrash File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\lib\site-packages\gym\envs\unittest\__init__.py", line 1, in <module> from gym.envs.unittest.cube_crash import CubeCrash File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\lib\site-packages\gym\envs\unittest\cube_crash.py", line 3, in <module> from gym import spaces File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\lib\site-packages\gym\spaces\__init__.py", line 1, in <module> from gym.spaces.box import Box File "D:\Users\F180024\AppData\Local\Programs\Python\Python37\lib\site-packages\gym\spaces\box.py", line 5, in <module> class Box(gym.Space): AttributeError: module 'gym' has no attribute 'Space'

@pzhokhov
Copy link
Collaborator

looks like some interference from previous package with similar name to me... could you post here the output of
python -c "import gym; print('version: {}, path: {}'.format(gym.__version__, gym.__file__))" ?

@lhorus
Copy link
Author

lhorus commented Sep 10, 2018

Actually I managed to fix it.
Anaconda was, for some reason, placing everything related to Gym on a Python 2.7 environment, and the rest on a 3.x environment.

Feel free to close it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants