ImportError: No module named 'glfw'
Failing to build mujoco-py. Initially failed due to missing 'swig' and 'patchelf', which was manually resolved. Now failing on 'glfw'. Calling 'import glfw' within (rlkit) conda environment works, though.
File "/tmp/pip-install-0n9doxzn/mujoco-py/setup.py", line 28, in run
import mujoco_py # noqa: force build
File "/tmp/pip-install-0n9doxzn/mujoco-py/mujoco_py/__init__.py", line 6, in <module>
from mujoco_py.mjviewer import MjViewer, MjViewerBasic
File "/tmp/pip-install-0n9doxzn/mujoco-py/mujoco_py/mjviewer.py", line 2, in <module>
import glfw
ImportError: No module named 'glfw'
We observed this issue on 2 machines. Thanks!
Are you importing mujoco_py within the rlkit conda environment as well? Is this error happening inside a docker image?
We are not using the docker image and instead followed these steps:
- git clone https://github.com/vitchyr/rlkit.git
- cp rlkit/launchers/config_template.py rlkit/launchers/config.py
- conda env create -f environment/linux-gpu-env.yml
We are using MuJoCo 1.5 and Ubuntu 16.04.
What did you run after to get the error? Did you activate the anaconda environment?
The error actually occurred in the 3. step. Before that, it failed on the 'swig' and 'patchelf' imports, which were resolved by manual installs. It then failed on the 'glfw' import. Thanks for taking the time!
Try removing glfw from the conda yml and install it manually.
Hi guys! I have a similar problem on Ubuntu 19
First, I tried:
- git clone https://github.com/vitchyr/rlkit.git 2 Copy conf.py to config.py 3 conda env create -f environment/linux-gpu-env.yml (here I got the same error No Module named glfw)
Then, I commented gym[all] from the yml file, and installed all manually (tested, and everything works fine). However, when I try to do: python /examples/ddpg.py
I got the error no module named 'rlkit' (while using the rlkit conda env). I have tried to manually add the rlkit path to the conda env, but the result is the same.
I don't know what I'm doing wrong. I'd appreciate if you can help me.
Cheers
@IwakuraAlise give virtualenv a try
Thanks, Richard!
It worked using virtualenv :)