AdrianP- / gym_trading

Apache License 2.0
94 stars 25 forks source link

Issue to start a new environnment #3

Closed Nicolas99-9 closed 6 years ago

Nicolas99-9 commented 6 years ago

I try to create a new environnment but I have a problem :

Traceback (most recent call last): File "test.py", line 16, in env = gym.make('trading-v0') File "/home/nicolas/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 163, in make return registry.make(id) File "/home/nicolas/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 121, in make patch_deprecated_methods(env) File "/home/nicolas/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 181, in patch_deprecated_methods env.seed = env._seed AttributeError: 'TradingEnv' object has no attribute '_seed'

Versions : gym (0.9.6)

Does it requires an older version of gym ?

Nicolas99-9 commented 6 years ago

Edit : I fixed it by adding self._seed = 99 in "trading_env.py".

AdrianP- commented 6 years ago

Thanks @Nicolas99-9

jalalmzh commented 6 years ago

@AdrianP Hi guys How can I fix this error?


runfile('C:/Users/jalal/Desktop/RL/gym_trading-master/run.py', wdir='C:/Users/jalal/Desktop/RL/gym_trading-master') Traceback (most recent call last):

File "", line 1, in runfile('C:/Users/jalal/Desktop/RL/gym_trading-master/run.py', wdir='C:/Users/jalal/Desktop/RL/gym_trading-master')

File "C:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile execfile(filename, namespace)

File "C:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/jalal/Desktop/RL/gym_trading-master/run.py", line 2, in import gym_trading

File "C:\Users\jalal\Desktop\RL\gym_trading-master\gym_trading__init__.py", line 5, in entry_point='gym_trading.envs:TradingEnv'

File "C:\Anaconda3\lib\site-packages\gym\envs\registration.py", line 164, in register return registry.register(id, **kwargs)

File "C:\Anaconda3\lib\site-packages\gym\envs\registration.py", line 157, in register raise error.Error('Cannot re-register id: {}'.format(id))

Error: Cannot re-register id: trading-v0