-
Notifications
You must be signed in to change notification settings - Fork 813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No module named 'mujoco_py.mjlib' #80
Comments
Updating the gym mujoco environments is on the roadmap, but for now gym's mujoco environments use the 0.5 version of mujoco-py. (gym itself doesn't require mujoco-py, though) https://github.com/openai/gym/blob/master/setup.py#L14 calls out the specific version needs. It's recommended to use python environments to have separate versions of mujoco-py for different uses. |
I'm using the mujoco envs in gym which do use the mujoco-py bindings, and
I'd like to switch to the latest version so I can make use of the headless
rendering on a remote server. Any idea if that's an easy change I can make
myself?
…On Mon, Jul 24, 2017 at 11:12 PM, Alex Ray ***@***.***> wrote:
Updating the gym mujoco environments is on the roadmap, but for now gym's
mujoco environments use the 0.5 version of mujoco-py. (gym itself doesn't
require mujoco-py, though)
https://github.com/openai/gym/blob/master/setup.py#L14 calls out the
specific version needs.
It's recommended to use python environments to have separate versions of
mujoco-py for different uses.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#80 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGT_iGcZxvDMFtgFxxE219x_S-SsZ8-wks5sRYdVgaJpZM4Oh2xr>
.
|
I think so. The mujoco environment wrappers (in gym) would need to be updated, as internal state (e.g. the XML files can stay the same I think. |
So I replaced mjlib and model.data with the new versions pymjmodel and
mjsim (I think) but am again getting glfw errors:
File
"/opt/conda/envs/pytorch-py35/lib/python3.5/site-packages/mujoco_py-1.50.1.10-py3.5.egg/mujoco_py/mjviewer.py",
line 132, in __init__
super().__init__(sim)
File
"/opt/conda/envs/pytorch-py35/lib/python3.5/site-packages/mujoco_py-1.50.1.10-py3.5.egg/mujoco_py/mjviewer.py",
line 26, in __init__
super().__init__(sim)
File "mujoco_py/mjrendercontext.pyx", line 246, in
mujoco_py.cymj.MjRenderContextWindow.__init__
File "mujoco_py/mjrendercontext.pyx", line 43, in
mujoco_py.cymj.MjRenderContext.__init__
File "mujoco_py/mjrendercontext.pyx", line 92, in
mujoco_py.cymj.MjRenderContext._setup_opengl_context
File "mujoco_py/opengl_context.pyx", line 44, in
mujoco_py.cymj.GlfwContext.__init__
File "mujoco_py/opengl_context.pyx", line 64, in
mujoco_py.cymj.GlfwContext._init_glfw
mujoco_py.cymj.GlfwError: Failed to initialize GLFW
so I assume in the new mujoco_py model and sim got explicitly separated to
enable headless rendering, but I am not familiar enough with the code to
understand how I should change the gym code to support this...and I
probably just re-mucked it up. Any tips? I'm just going through
the mujoco/mujoco_env.py file and fixing all the parts that broke with new
mujoco_py...
…On Tue, Jul 25, 2017 at 10:21 AM, Alex Ray ***@***.***> wrote:
I think so. The mujoco environment wrappers (in gym) would need to be
updated, as internal state (e.g. qpos, qvel, etc) is accessed differently.
the XML files can stay the same I think.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#80 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGT_iOhyeibnEi6BcT7G-3vgZT3glzmBks5sRiQtgaJpZM4Oh2xr>
.
|
We got this working, we'll try to push a PR soon if anyone's interested. |
@adamlerer great news, any update about the status of the PR? |
Any update? This would be very helpful to me |
I extracted the relevant changes into this branch (co-authored with @yayitsamyzhang ): https://github.com/adamlerer/gym/tree/mujoco-1.0 I don't have any test cases except an internal environment that we are working on, so I don't know if it will be accepted as a PR yet, but you can fork that branch and try it out. Let me know if it works for you! |
@adamlerer @yayitsamyzhang That's great news. I tried the mujoco-1.0 branch, but got the follow error: Any tips? |
Any progress on this? |
@jalexvig progress on what? @DoraXingyu I didn't update the individual envs; I think that |
@adamlerer Wondering if anyone had been testing this/ working on getting the PR merged |
@adamlerer Sorry, not sure what you meant by got this working.
|
@adamlerer Hi, I tried your gym version, but am getting the error. If possible could you suggest any directions.
|
Did you install mujoco_py?
…On Sun, Nov 12, 2017 at 12:26 AM, Abhishek Bhatia ***@***.***> wrote:
@adamlerer <https://github.com/adamlerer> Hi, I tried your gym version,
but am getting the error. If possible could you suggest any directions.
python -c "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)"
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "mujoco_py/cymj.pyx", line 132, in mujoco_py.cymj.load_model_from_path
Exception: Failed to load XML file: /nohome/jaan/abhishek/anaconda3/lib/python3.6/site-packages/mujoco_py-1.50.1.31-py3.6.egg/xmls/claw.xml. mj_loadXML error: b'XML parse error at line 0, column 0:\nFailed to open file\n'
✘ gonzo ~/a/p/m/gym master python
Python 3.6.1 |Anaconda custom (64-bit)| (default, May 11 2017, 13:09:58)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gym
>>> exit()
gonzo ~/a/p/m/gym master ipython
Python 3.6.1 |Anaconda custom (64-bit)| (default, May 11 2017, 13:09:58)
Type "copyright", "credits" or "license" for more information.
IPython 5.3.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import gym
In [2]: gym.make("Hopper-v1")
[2017-11-12 00:24:55,044] Making new env: Hopper-v1
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
/nohome/jaan/abhishek/packages/mujoco_diff/gym/gym/envs/mujoco/mujoco_env.py in <module>()
11 import mujoco_py
---> 12 from mujoco_py.mjlib import mjlib
13 except ImportError as e:
ModuleNotFoundError: No module named 'mujoco_py.mjlib'
During handling of the above exception, another exception occurred:
DependencyNotInstalled Traceback (most recent call last)
<ipython-input-2-15e33d66bf45> in <module>()
----> 1 gym.make("Hopper-v1")
/nohome/jaan/abhishek/packages/mujoco_diff/gym/gym/envs/registration.py in make(id)
162
163 def make(id):
--> 164 return registry.make(id)
165
166 def spec(id):
/nohome/jaan/abhishek/packages/mujoco_diff/gym/gym/envs/registration.py in make(self, id)
120 logger.info('Making new env: %s', id)
121 spec = self.spec(id)
--> 122 env = spec.make()
123 if (env.spec.timestep_limit is not None) and not spec.tags.get('vnc'):
124 from gym.wrappers.time_limit import TimeLimit
/nohome/jaan/abhishek/packages/mujoco_diff/gym/gym/envs/registration.py in make(self)
86 env = self._entry_point()
87 else:
---> 88 cls = load(self._entry_point)
89 env = cls(**self._kwargs)
90
/nohome/jaan/abhishek/packages/mujoco_diff/gym/gym/envs/registration.py in load(name)
15 def load(name):
16 entry_point = pkg_resources.EntryPoint.parse('x={}'.format(name))
---> 17 result = entry_point.load(False)
18 return result
19
/nohome/jaan/abhishek/anaconda3/lib/python3.6/site-packages/pkg_resources/__init__.py in load(self, require, *args, **kwargs)
2314 if require:
2315 self.require(*args, **kwargs)
-> 2316 return self.resolve()
2317
2318 def resolve(self):
/nohome/jaan/abhishek/anaconda3/lib/python3.6/site-packages/pkg_resources/__init__.py in resolve(self)
2320 Resolve the entry point from its module and attrs.
2321 """
-> 2322 module = __import__(self.module_name, fromlist=['__name__'], level=0)
2323 try:
2324 return functools.reduce(getattr, self.attrs, module)
/nohome/jaan/abhishek/packages/mujoco_diff/gym/gym/envs/mujoco/__init__.py in <module>()
----> 1 from gym.envs.mujoco.mujoco_env import MujocoEnv
2 # ^^^^^ so that user gets the correct error
3 # message if mujoco is not installed correctly
4 from gym.envs.mujoco.ant import AntEnv
5 from gym.envs.mujoco.half_cheetah import HalfCheetahEnv
/nohome/jaan/abhishek/packages/mujoco_diff/gym/gym/envs/mujoco/mujoco_env.py in <module>()
12 from mujoco_py.mjlib import mjlib
13 except ImportError as e:
---> 14 raise error.DependencyNotInstalled("{}. (HINT: you need to install mujoco_py, and also perform the setup instructions here: https://github.com/openai/mujoco-py/.)".format(e))
15
16 class MujocoEnv(gym.Env):
DependencyNotInstalled: No module named 'mujoco_py.mjlib'. (HINT: you need to install mujoco_py, and also perform the setup instructions here: https://github.com/openai/mujoco-py/.)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#80 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGT_iGL4NvPLmyAAnuUZIx9sgdeQ2L_sks5s1quxgaJpZM4Oh2xr>
.
|
@abhigenie92 Not sure if you figured it out already, but just in case: |
@yayitsamyzhang @adamlerer Tried your version of gym, still facing |
where do I download the old version of mujoco-py so that the gym will support it? |
I am using MacOS Sierra 10.12.6 and Python 3.5.2 Anaconda environment I had an identical issue like @abhigenie92 and previously like #74 I solved it by:
You should be able to have this example working:
|
@nemanja-rakicevic this worked great! python setup.py install was the main fix |
@nemanja-rakicevic thanks for the info. I tried it but for me it failed upon running the example:
|
@kirk86 so one issue might be that you're using python 3.6, I think gym has problems with 3.6. Another issue could be related to the gcc update. |
@nemanja-rakicevic thanks a lot. Appreciate it! I thought that by reading the docs they mentioned that they released PR in which they support python 3.6?
I don't understand why that could be an issue. It's version 5.4.x ? The main error is here: Anyways thanks again. 😉 |
@kirk86 : Looks like libglew-dev is not installed. Use all the dependencies mentioned in this Dockerfile: https://github.com/openai/mujoco-py/blob/master/Dockerfile |
Has the mjlib module been deleted in mujoco-py? What if I want to use some built-in functions such as mj_fwdPosition? |
Check this example. Basically you can use |
Looks like gym is not compatible with the latest mujoco-py version. When will it be updated/what do I use to replace the mjlib dependency?
The text was updated successfully, but these errors were encountered: