rlkit icon indicating copy to clipboard operation
rlkit copied to clipboard

ImportError: No module named 'glfw'

Open tseyde opened this issue 6 years ago • 8 comments

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!

tseyde avatar Feb 14 '19 00:02 tseyde

Are you importing mujoco_py within the rlkit conda environment as well? Is this error happening inside a docker image?

vitchyr avatar Feb 14 '19 00:02 vitchyr

We are not using the docker image and instead followed these steps:

  1. git clone https://github.com/vitchyr/rlkit.git
  2. cp rlkit/launchers/config_template.py rlkit/launchers/config.py
  3. conda env create -f environment/linux-gpu-env.yml

We are using MuJoCo 1.5 and Ubuntu 16.04.

tseyde avatar Feb 14 '19 01:02 tseyde

What did you run after to get the error? Did you activate the anaconda environment?

vitchyr avatar Feb 14 '19 02:02 vitchyr

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!

tseyde avatar Feb 14 '19 03:02 tseyde

Try removing glfw from the conda yml and install it manually.

richardrl avatar Feb 22 '19 17:02 richardrl

Hi guys! I have a similar problem on Ubuntu 19

First, I tried:

  1. 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

arzate-christian avatar Jul 05 '19 06:07 arzate-christian

@IwakuraAlise give virtualenv a try

richardrl avatar Jul 07 '19 06:07 richardrl

Thanks, Richard!

It worked using virtualenv :)

arzate-christian avatar Jul 08 '19 01:07 arzate-christian