Mujoco-py: gym.make() is frozen, takes infinite time to run

Created on 28 Feb 2019  路  10Comments  路  Source: openai/mujoco-py

Describe the bug
when i run the following code,
env = gym.make('InvertedPendulum-v2') ,the lines takes infinite time to run. It doesn't return a value.

Error Messages
No error messages. It just doesn't seem to make the environment.

Desktop (please complete the following information):

  • OS: Ubuntu 16.04
  • Python Version Python 3.6 Conda environment
  • Mujoco Version Latest
  • mujoco-py version Latest

Most helpful comment

If the mujoco_py is installed in the user machine, delete the mujocopy-buildlock.lock and machine-2342urwqpeur in the following directory:

~/.local/lib/python3.5/site-packages/mujoco_py/generated

All 10 comments

Same issue occurred when using stable baseline to train Mujoco agent.
Reinstall doesn't help.
cancel progress get this message below:
`^CTraceback (most recent call last):
File "/anaconda3/envs/py36/lib/python3.6/site-packages/lockfile/linklockfile.py", line 31, in acquire
os.link(self.unique_name, self.lock_file)
FileExistsError: [Errno 17] File exists: '/anaconda3/envs/py36/lib/python3.6/site-packages/mujoco_py/generated/Oblivions-MBP.local-10da65c0.566-2556899123345859329' -> '/anaconda3/envs/py36/lib/python3.6/site-packages/mujoco_py/generated/mujocopy-buildlock.lock'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/anaconda3/envs/py36/lib/python3.6/site-packages/mujoco_py/__init__.py", line 3, in
from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
File "/anaconda3/envs/py36/lib/python3.6/site-packages/mujoco_py/builder.py", line 503, in
cymj = load_cython_ext(mjpro_path)
File "/anaconda3/envs/py36/lib/python3.6/site-packages/mujoco_py/builder.py", line 89, in load_cython_ext
with LockFile(lockpath):
File "/anaconda3/envs/py36/lib/python3.6/site-packages/lockfile/__init__.py", line 197, in __enter__
self.acquire()
File "/anaconda3/envs/py36/lib/python3.6/site-packages/lockfile/linklockfile.py", line 50, in acquire
time.sleep(timeout is not None and timeout / 10 or 0.1)
KeyboardInterrupt
`

Go to folder /anaconda3/envs/py36/lib/python3.6/site-packages/mujoco_py/generated/ and delete Oblivions-MBP.local-10da65c0.566-2556899123345859329 (in my case) that helps. Hoping it works for you as well. @HareshMiriyala

@fengredrum thanks

I have the same issue. I tried to remove local files in the generated folder but it doesn't help.

@Wenxuan-Zhou . Try to delete files end with long number strings such as "beta-System-Product-Name-56e21740.6126-3597545483291144405" and "mujocopy-buildlock.lock". At least, it works for me.

If the mujoco_py is installed in the user machine, delete the mujocopy-buildlock.lock and machine-2342urwqpeur in the following directory:

~/.local/lib/python3.5/site-packages/mujoco_py/generated

@mingfeisun It works well now, but I am quite curious why these files are generated and block the Mujoco environment to be created ?

Delete MACHINENAME-xxxxxx and mujocopy-buildlock.lock really help. I am also wondering why this happen and how to avoid it in the future.

pip3 uninstall mujoco_py && pip3 install mujoco_py

urn off "attach to processes automatically" could solve it although maybe not proper solution.

Check this https://youtrack.jetbrains.com/issue/PY-44481

Was this page helpful?
0 / 5 - 0 ratings

Related issues

XuanLin picture XuanLin  路  14Comments

soerendip picture soerendip  路  22Comments

richardrl picture richardrl  路  16Comments

jonasschneider picture jonasschneider  路  48Comments

amyzhang picture amyzhang  路  25Comments