Mujoco-py: OSError while trying Reacher or Push examples

Created on 19 Mar 2018  路  1Comment  路  Source: openai/mujoco-py

Issue #83 and #167 does not solve the problem.

Traceback (most recent call last):
File "C:/Users/ezarvma/PycharmProjects/open_1/first.py", line 2, in
env = gym.make('Reacher-v2')
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\site-packages\gym\envs\registration.py", line 163, in make
return registry.make(id)
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\site-packages\gym\envs\registration.py", line 119, in make
env = spec.make()
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\site-packages\gym\envs\registration.py", line 85, in make
cls = load(self._entry_point)
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\site-packages\gym\envs\registration.py", line 14, in load
result = entry_point.load(False)
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pkg_resources__init__.py", line 2229, in load
return self.resolve()
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pkg_resources__init__.py", line 2235, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\site-packages\gym\envs\mujoco__init__.py", line 1, in
from gym.envs.mujoco.mujoco_env import MujocoEnv
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\site-packages\gym\envs\mujoco\mujoco_env.py", line 11, in
import mujoco_py
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\site-packages\mujoco_py__init__.py", line 4, in
from .mjviewer import MjViewer
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\site-packages\mujoco_py\mjviewer.py", line 7, in
from . import mjcore, mjconstants, glfw
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\site-packages\mujoco_py\mjcore.py", line 6, in
from .mjlib import mjlib
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\site-packages\mujoco_py\mjlib.py", line 21, in
mjlib = cdll.LoadLibrary(os.path.abspath(libfile))
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\ctypes__init__.py", line 425, in LoadLibrary
return self._dlltype(name)
File "C:\Users\ezarvma\AppData\Local\Programs\Python\Python35-32\lib\ctypes__init__.py", line 347, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

Process finished with exit code 1

I'm using Pycharm IDE on Win10, mujoco-py 0.5 and the error is the same with Python 2.7 and 3.5.2 interpreters.

Libraries: .mujoco/mjpro131 and here is my mjkey licence aswell.

To me seems like it can not load the mjlib library.

Most helpful comment

Encounter the same problem.

Fixed by editing some files manually:

mjlib.py
from

line 14
elif sys.platform.startswith("win"):
    libfile = os.path.join(path_prefix, "bin/mujoco131.lib")

to

elif sys.platform.startswith("win"):
    libfile = os.path.join(path_prefix, "bin/mujoco131.dll")

platname_targdir.py

line 6
elif sys.platform.startswith("win"):
    platname = "win"

>All comments

Encounter the same problem.

Fixed by editing some files manually:

mjlib.py
from

line 14
elif sys.platform.startswith("win"):
    libfile = os.path.join(path_prefix, "bin/mujoco131.lib")

to

elif sys.platform.startswith("win"):
    libfile = os.path.join(path_prefix, "bin/mujoco131.dll")

platname_targdir.py

line 6
elif sys.platform.startswith("win"):
    platname = "win"
Was this page helpful?
0 / 5 - 0 ratings

Related issues

dialogchat picture dialogchat  路  3Comments

samuela picture samuela  路  3Comments

bebbo203 picture bebbo203  路  3Comments

ashBabu picture ashBabu  路  3Comments

yasiemir picture yasiemir  路  5Comments