1

I want to install glfw and want to use glfw with python3 to finish my homework. But there is some matters when install glfw in mac terminal.

First, I input 'pip3 install glfw' in terminal.

Second, in terminal input 'python3' into python 3.x version. and input 'import glfw'. But there gave me an error message

"Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/glfw/init.py", line 34, in raise ImportError("Failed to load GLFW3 shared library.") ImportError: Failed to load GLFW3 shared library."

Third, I input 'brew install glfw3'. And there was an error message

"Warning: glfw 3.2.1 is already installed, it's just not linked You can use brew link glfw to link this version.

Forth, I input 'brew link glfw' in terminal, it told me

"Linking /usr/local/Cellar/glfw/3.2.1... Error: Could not symlink lib/cmake/glfw3 /usr/local/lib/cmake is not writable."

So I don't know how to handling this problem, can anyone help me? Thank you!

kw Hyun
  • 67
  • 7
  • I tried sudo brew link glfw the error message is "Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system." – kw Hyun Mar 27 '19 at 06:51
  • yeah, actually the command should be `brew link glfw --force` – l'L'l Mar 27 '19 at 08:52

1 Answers1

0

I tried

sudo chown -R $(whoami) $(brew --prefix)/*

in terminal.

I got this command in

Brew doctor says: "Warning: /usr/local/include isn't writable."

But I don't know why that command linked glfw library.

kw Hyun
  • 67
  • 7