Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"ImportError: Failed to load GLFW3 shared library" without root access on Linux

I'm trying to run a Python3 code found on GitHub on a remote machine that I don't have root access. The code requires to import glfw dependency .

While pip3 install --user glfw seems to work perfectly fine (exactly like all the other python dependencies), when I try to run the code I get:

Traceback (most recent call last): File "", line 1, in File "/home/ismarou/.local/lib/python3.5/site-packages/glfw/init.py", line 34, in raise ImportError("Failed to load GLFW3 shared library.") ImportError: Failed to load GLFW3 shared library.

Is there anything I missed?

like image 343
ismarou Avatar asked Aug 19 '18 14:08

ismarou


2 Answers

You need to install both glfw3 and python bindings for glfw3. With pip install --user glfw you installed only the bindings. Now you have to install glfw3 on your system.

I had the same problem on Ubuntu 18.04. Installation of libglfw3 and libglfw3-dev solved it.

sudo apt-get install libglfw3
sudo apt-get install libglfw3-dev
like image 75
Denis Avatar answered Nov 14 '22 06:11

Denis


helped the pip3 install glfw in the same directory of the build project

enter image description here

like image 42
Alma Konde Avatar answered Nov 14 '22 05:11

Alma Konde