question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fatal error: mjmodel.h: No such file or directory

See original GitHub issue

Trying to install this from scratch. Here are my steps:

git clone https://github.com/openai/baselines.git
cd baselines
mkvirtualenv openai -p python3.6
pip install -e .
...
Building wheels for collected packages: gym, zmq, dill, mpi4py, mujoco-py, glfw, pycparser
  Running setup.py bdist_wheel for gym ... done
  Stored in directory: /home/maddoxw/.cache/pip/wheels/a8/e4/fc/145832d732d33de702076907d7c3b4c47ba4302dbedd35fc80
  Running setup.py bdist_wheel for zmq ... done
  Stored in directory: /home/maddoxw/.cache/pip/wheels/1e/ab/58/d386fd5ba7223e06c34ad0e096a23b2c36c9b077d2fa479325
  Running setup.py bdist_wheel for dill ... done
  Stored in directory: /home/maddoxw/.cache/pip/wheels/e5/88/fe/7e290ce5bb39d531eb9bee5cf254ba1c3e3c7ba3339ce67bee
  Running setup.py bdist_wheel for mpi4py ... done
  Stored in directory: /home/maddoxw/.cache/pip/wheels/13/e2/e6/4a43d9f0ab84f7780c3084eddfa98621872aa349fa4daca464
  Running setup.py bdist_wheel for mujoco-py ... error
  Complete output from command /home/maddoxw/.virtualenvs/openai/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5ihzx1e2/mujoco-py/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpvuef1fropip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  Compiling /tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/cymj.pyx because it changed.
  [1/1] Cythonizing /tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/cymj.pyx
  running build_ext
  building 'mujoco_py.cymj' extension
  creating /tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder
  creating /tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.6
  creating /tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.6/tmp
  creating /tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.6/tmp/pip-build-5ihzx1e2
  creating /tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.6/tmp/pip-build-5ihzx1e2/mujoco-py
  creating /tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.6/tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py
  creating /tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.6/tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/gl
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Imujoco_py -I/tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py -I/home/maddoxw/.mujoco/mjpro150/include -I/home/maddoxw/.virtualenvs/openai/lib/python3.6/site-packages/numpy/core/include -I/tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/vendor/egl -I/usr/include/python3.6m -I/home/maddoxw/.virtualenvs/openai/include/python3.6m -c /tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/cymj.c -o /tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/generated/_pyxbld_LinuxExtensionBuilder/temp.linux-x86_64-3.6/tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/cymj.o -fopenmp -w
  /tmp/pip-build-5ihzx1e2/mujoco-py/mujoco_py/cymj.c:568:21: fatal error: mjmodel.h: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I’m only showing the last few stages of the install for brevity. I can provide the full verbose output if need be. My OS is Ubuntu 16.04. Any ideas on what the issue might be? Has anyone had success installing in a virtualenv?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
Sohojoecommented, Feb 18, 2018

I saw this error when reinstalling on windows today. The solution for me was:

  1. install gym manually,
  2. remove this line from setup.py 'gym[mujoco,atari,classic_control]',
  3. install baselines

I belive the problem for me was mujoco-py (which I’ve not been able to get running on windows)

0reactions
ghostcommented, Mar 18, 2018

@Sohojoe Hey, I’m having the same trouble: Can’t install mujoco-py on my windows and thus can’t install baselines. Could you please explain how to perform step 2? do I have to use git or something like that to be able to remove this line? or is it also possible using pip install regularly? Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

fatal error: mjmodel.h: No such file or directory #310 - GitHub
Below is the error, i believe others are having this issue but I couldnt find a solution. Also trying this from a Mac....
Read more >
error when using pip to install mujoco library - Stack Overflow
Hi I get an error when I pip install a library called mujoco-py . ... fatal error: Python.h: No such file or directory...
Read more >
fatal error: mjmodel.h: No such file or directory compilation ...
I Installed everything just fine without errors and the physics engine works, but when i try to use it with gym i get...
Read more >
API Reference - MuJoCo documentation
It invokes the built-in parser and compiler, and either returns a pointer to a valid mjModel, or NULL - in which case the...
Read more >
ubuntu18.04安装mujoco150出现fatal error: mjmodel.h
ubuntu18.04安装mujoco150出现fatal error: mjmodel.h: No such file or directory###问题1在将下载好的mjpro150_linux.zip移动在.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found