mujoco-py icon indicating copy to clipboard operation
mujoco-py copied to clipboard

AttributeError: module 'mujoco_py' has no attribute 'load_model_from_path'

Open vitoriaob opened this issue 2 years ago • 2 comments

I'm trying to run a very simple code using mujoco-py and dm_control suite:

import mujoco_py
from mujoco_py import utils
import dm_control
import os.path

filename = "package.xml"

path = os.path.abspath(filename)

# Load MuJoCo model
model = mujoco_py.load_model_from_path(path)

# Create a simulation environment
sim = mujoco_py.MjSim(model)

# Initialize the dm_control environment
env = suite.load(domain_name="TestOP3", task_name="OP3GRAVITY")

I cannot solve the recurrent error "module 'mujoco_py' has no attribute 'load_model_from_path'"

I saw past issues here and I tried to solve it in all possible ways but nothing has any effect. I already:

  • installed gym == 0.9.1
  • installed cython<3

My current environment is:

  • OS: macOS Monterrey 12.6.1
  • Python Version 3.11.2
  • Mujoco Version 3.0.0
  • mujoco-py version 2.1.2.14
  • Cython version: 0.29.33

Is there anyone who knows how to solve this? Thanks in advance

vitoriaob avatar Nov 01 '23 02:11 vitoriaob

i am also having the same issue

sainavaneet avatar Apr 07 '24 08:04 sainavaneet

i am also having the same issue

lhchank avatar Jul 12 '24 16:07 lhchank