I have a environment which has the custom architecture like this:
class environment(gym.Env):
metadata ={'render.modes': ['human']}
ACTION = ['buy', 'do not buy']
def __init__(self, df):
pass
def reset(self):
#Reset the state of the environment to an initial state
return self._next_observation()
def step(self, action):
pass
def _next_observation(self):
pass
def _get_reward(self):
pass
def _take_action(self, action):
pass
def render(self, mode = 'human', close=False):
pass
When creating a package by creating folder system like this
----- env
---------- env
---------- init.py
---------- setup.py
--------------- env.py
--------------- __init__py
I receive my package with pip install -e .
I get my custom environment. However, when trying to retrieve my environment by gym.make('env-v0')
I get the following traceback:
File "C:UsersAWDesktopImitationLearningFruitFruitrain_reinforcement_learning-fruits.py", line 11, in <module>
env = gym.make('FruitEnv-v0')
File "C:UserAWAnaconda3libsite-packagesgymenvs
egistration.py", line 145, in make
return registry.make(id, **kwargs)
File "C:UsersAWAnaconda3libsite-packagesgymenvs
egistration.py", line 90, in make
env = spec.make(**kwargs)
File "C:UsersAWAnaconda3libsite-packagesgymenvs
egistration.py", line 59, in make
cls = load(self.entry_point)
File "C:UsersAWAnaconda3libsite-packagesgymenvs
egistration.py", line 17, in load
mod_name, attr_name = name.split(":")
ValueError: not enough values to unpack (expected 2, got 1)
Can someone tell me what's missing?
question from:
https://stackoverflow.com/questions/65935310/valueerror-not-enough-values-to-unpack-expected-2-got-1-custom-environment 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…