Mujoco-py: module 'mujoco_py' has no attribute 'load_model_from_path'

Created on 31 May 2018  Â·  7Comments  Â·  Source: openai/mujoco-py

Hello everyone,
have you ever met the problem " module 'mujoco_py' has no attribute 'load_model_from_path' ".
When I installed the MuJoCo 131, mujoco_py 0.5.7 and gym and tried to test the installation,

$ python3
import mujoco_py
from os.path import dirname
model = mujoco_py.load_model_from_path(dirname(dirname(mujoco_py.__file__))  +"/xmls/claw.xml")
sim = mujoco_py.MjSim(model)

I got the prompt:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'mujoco_py' has no attribute 'load_model_from_path'

My python version is 3.5.5.
How can I solve the problem? Thanks!

Most helpful comment

I found that the following configuration can make it work:
mujoco:131
mujoco_py:0.5.7
tensorflow:1.5.0
gym:0.9.1
python3.6
but you may need to use the order version of environment models in mujoco platform.
(eg. you have to use 'InvertedPendulum-v1' in stead of the higher version'InvertedPendulum-v2')
Good luck~

All 7 comments

same problem

Hi guys, I think our problem can be solved with install gym 0.9.1.
See #244

@IcarusWizard I have the same problem,and I have changed the version of gym to 0.9.1,but the problem is still here....

I found that the following configuration can make it work:
mujoco:131
mujoco_py:0.5.7
tensorflow:1.5.0
gym:0.9.1
python3.6
but you may need to use the order version of environment models in mujoco platform.
(eg. you have to use 'InvertedPendulum-v1' in stead of the higher version'InvertedPendulum-v2')
Good luck~

It works when I install gym==0.9.1!But some problems occur that some gym environments are not in use.

@hangwudy i think the issue you have is that mujoco-py is out of date.

Do you get the same error with the latest mujoco-py?

installing gym 0.9.1 fixes this issue

python -m pip install gym==0.9.1

Was this page helpful?
0 / 5 - 0 ratings