openai / mujoco-py

MuJoCo is a physics engine for detailed, efficient rigid body simulations with contacts. mujoco-py allows using MuJoCo from Python 3.
Other
2.85k stars 815 forks source link

Issue when importing mujoco_py (crypt.h: No such file or directory) #798

Open jayaramreddy10 opened 3 months ago

jayaramreddy10 commented 3 months ago

Describe the bug Hi, I installed mujoco_py using pip (pip3 install -U 'mujoco-py<2.2,>=2.1') but when trying to import, I am getting error message.

Error Messages

import mujoco_py In file included from /home/jayaram/.mujoco/mujoco-py/mujoco_py/cymj.c:57: /home/jayaram/miniconda3/envs/psl2/include/python3.8/Python.h:44:10: fatal error: crypt.h: No such file or directory 44 | #include | ^~~~~ compilation terminated. Traceback (most recent call last): File "/home/jayaram/miniconda3/envs/psl2/lib/python3.8/site-packages/setuptools/_distutils/unixccompiler.py", line 188, in _compile self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs) File "/home/jayaram/miniconda3/envs/psl2/lib/python3.8/site-packages/setuptools/_distutils/ccompiler.py", line 1041, in spawn spawn(cmd, dry_run=self.dry_run, **kwargs) File "/home/jayaram/miniconda3/envs/psl2/lib/python3.8/site-packages/setuptools/_distutils/spawn.py", line 68, in spawn raise DistutilsExecError(f"command {cmd!r} failed with exit code {exitcode}") distutils.errors.DistutilsExecError: command '/home/jayaram/miniconda3/envs/psl2/bin/gcc' failed with exit code 1

Desktop (please complete the following information):

Mujoco is working fine, able to run the examples.

Did I miss anything? Please let me know if any other details are required?