Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named 'glfw' #34

Open
tseyde opened this issue Feb 14, 2019 · 8 comments
Open

ImportError: No module named 'glfw' #34

tseyde opened this issue Feb 14, 2019 · 8 comments

Comments

@tseyde
Copy link

tseyde commented Feb 14, 2019

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!

@vitchyr
Copy link
Collaborator

vitchyr commented Feb 14, 2019

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

@tseyde
Copy link
Author

tseyde commented Feb 14, 2019

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.

@vitchyr
Copy link
Collaborator

vitchyr commented Feb 14, 2019

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

@tseyde
Copy link
Author

tseyde commented Feb 14, 2019

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!

@richardrl
Copy link
Contributor

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

@arzate-christian
Copy link

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

@richardrl
Copy link
Contributor

@IwakuraAlise give virtualenv a try

@arzate-christian
Copy link

Thanks, Richard!

It worked using virtualenv :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants