Open sankethvedula opened 7 years ago
this worked for me, it is in the init.py file in he gym_trading folder
from gym.envs.registration import register
register( id='trading-v1', entry_point='gym_trading.envs:TradingEnv', timestep_limit=1000)
I'm having the same issue - and both proposed solutions didnt work...
here is the error:
[2017-06-07 14:21:50,524] policy_gradient logger started.
[2017-06-07 14:21:50,524] Making new env: trading-v0
Traceback (most recent call last):
File "envs/test_policy_gradient.py", line 16, in <module>
env = gym.make('trading-v0')
File "/usr/local/lib/python2.7/dist-packages/gym/envs/registration.py", line 161, in make
return registry.make(id)
File "/usr/local/lib/python2.7/dist-packages/gym/envs/registration.py", line 118, in make
spec = self.spec(id)
File "/usr/local/lib/python2.7/dist-packages/gym/envs/registration.py", line 147, in spec
raise error.UnregisteredEnv('No registered env with id: {}'.format(id))
gym.error.UnregisteredEnv: No registered env with id: trading-v0
tried importing gym_pull as suggested, but "no module named gym_trading"
id='trading-v1', called the environment v1
@baolinliu thanks but how does that help? Now it's:
gym.error.UnregisteredEnv: No registered env with id: trading-v1
I tried around for a few days, but in the end it worked with sudo pip install -e .
I'm not sure why using the -e flag made it work.
also I had to move the register call into test_policy_gradient.
Additionally with newer gym version you'd need to call env=env.unwrapped
can't get it work. what's the install procedure? pip install -e . shows Running setup.py develop for gym-trading Successfully installed gym-trading
but still gym.error.UnregisteredEnv: No registered env with id: trading-v0
according to registration.py
of gym library, env object is wrapped in a TimeLimit object
env = TimeLimit(env, max_episode_steps=env.spec.max_episode_steps,max_episode_seconds=env.spec.max_episode_seconds)
so use env.env
to run those methods such as run_strats
the reason is that the environment did't register into the gym module. change the init.py file in the same directory with env as below: from gym.envs.registration import register
register( id='trading-v0', entry_point='gym_trading.envs.trading_env:TradingEnv', timestep_limit=1000, ) the entry_point should be 'gym_trading.envs.trading_env:TradingEnv'
still not working
Not working for me either. If I include import gym_trading, it doesn't pass this step. and if I comment it, I get the registration error above.
After some packages update(e.g. the gym module), the notebook in the github will throw errors. So I fixed some of the issues and also made the corresponding changes required so that it can run smoothly in colab. You may find the colab notebook link here: https://colab.research.google.com/drive/14OIx32e_pzqpMIhhRcPV5CMAHUAwVQK1
After running this code:
trading_environment = gym.make('trading-v0', ticker='AAPL', trading_days=trading_days, trading_cost_bps=trading_cost_bps, time_cost_bps=time_cost_bps) trading_environment.seed(42)
I get an assertion error and I don't know how to get past it if anyone can help.
Hi,
I am kind of new to this OpenAI Gym.
While I was trying to run the test_policy_gradient.py file, I am getting the following error.
trying to debug, I included " import gym_trading" in the beginning of the file.
Now, I am facing the following error![unnamed 1](https://cloud.githubusercontent.com/assets/7271095/25069768/b7b28930-22a8-11e7-91b2-b27fbecfdb53.jpg)
I understand that for some reason, the data frame isn't getting downloaded when I "make" the gym to create an environment, which is why I suspect I am getting this error.
Could you please point out where I am going wrong? Or if there is any fix around this?
Thanks a lot in advance! Sanketh