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

2

7

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?

Syllabic answered 19/8, 2018 at 14:28 Comment(0)
W
9

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
Williswillison answered 6/10, 2018 at 7:7 Comment(1)
for some reason in my setup python still could not find the glfw shared library. I checked that it can get it via the environment variable PYGLFW_LIBRARY and exported the variable to the path: set -x PYGLFW_LIBRARY /usr/lib/i386-linux-gnu/libglfw.so (in fish shell). It works.Engrain
C
1

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

enter image description here

Colleague answered 23/2, 2021 at 12:56 Comment(1)
Can you explain your answer? How does solve the question? How does it differ from other answer?Psychodynamics

© 2022 - 2024 — McMap. All rights reserved.