AminHP / gym-anytrading

The most simple, flexible, and comprehensive OpenAI Gym trading environment (Approved by OpenAI Gym)
MIT License
2.09k stars 459 forks source link

ModuleNotFoundError: No module named 'your_module' #97

Closed Mp9909 closed 8 months ago

Mp9909 commented 8 months ago

Hi, I am trying to create an env with stocks-v0 but I get the error ModuleNotFoundError: No module named 'your_module'

env = gym.make('stocks-v0', df=df, frame_bound=(5, 100), window_size=5)


ModuleNotFoundError Traceback (most recent call last) c:\trading_ai.ipynb Cell 9 line 1 ----> 1 env = gym.make('stocks-v0', df=df, frame_bound=(5, 100), window_size=5)

File c:\env\lib\site-packages\gym\envs\registration.py:581, in make(id, max_episode_steps, autoreset, apply_api_compatibility, disable_env_checker, **kwargs) 578 envcreator = spec.entry_point 579 else: 580 # Assume it's a string --> 581 envcreator = load(spec.entry_point) 583 mode = _kwargs.get("render_mode") 584 apply_human_rendering = False

File c:\env\lib\site-packages\gym\envs\registration.py:61, in load(name) 52 """Loads an environment with name and returns an environment creation function 53 54 Args: (...) 58 Calls the environment constructor 59 """ 60 mod_name, attr_name = name.split(":") ---> 61 mod = importlib.import_module(mod_name) 62 fn = getattr(mod, attr_name) 63 return fn ... File :991, in _find_andload(name, import)

File :973, in _find_and_loadunlocked(name, import)

ModuleNotFoundError: No module named 'your_module'

kmafutah commented 8 months ago

I hope you are aware that this module migrated to gymnasium you might want to do a import gymnasium as gym or use earlier versions that used the old gym.

Regards

On Thu, 23 Nov 2023 at 00:14, Mp9909 @.***> wrote:

Hi, I am trying to create an env with stocks-v0 but I get the error ModuleNotFoundError: No module named 'your_module'

env = gym.make('stocks-v0', df=df, frame_bound=(5, 100), window_size=5)

ModuleNotFoundError Traceback (most recent call last) c:\trading_ai.ipynb Cell 9 line 1 ----> 1 env = gym.make('stocks-v0', df=df, frame_bound=(5, 100), window_size=5)

File c:\env\lib\site-packages\gym\envs\registration.py:581, in make(id, max_episode_steps, autoreset, apply_api_compatibility, disable_env_checker, **kwargs) 578 envcreator = spec.entry_point 579 else: 580 # Assume it's a string --> 581 envcreator = load(spec.entry_point) 583 mode = _kwargs.get("render_mode") 584 apply_human_rendering = False

File c:\env\lib\site-packages\gym\envs\registration.py:61, in load(name) 52 """Loads an environment with name and returns an environment creation function 53 54 Args: (...) 58 Calls the environment constructor 59 """ 60 mod_name, attr_name = name.split(":") ---> 61 mod = importlib.import_module(mod_name) 62 fn = getattr(mod, attr_name) 63 return fn ... File :991, in find_and_load(name, import)

File :973, in find_and_load_unlocked(name, import)

ModuleNotFoundError: No module named 'your_module'

— Reply to this email directly, view it on GitHub https://github.com/AminHP/gym-anytrading/issues/97, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7JXS6FXCGXI5CM2E63JN3YF2BNJAVCNFSM6AAAAAA7W6KGSKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYDOMRTGI3TINY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Mp9909 commented 8 months ago

Thanks, I was following an old yt video. Still quite new to coding.