1

Code:from p5 import *
Error

Traceback (most recent call last): File "C:\Users\Anvit\Desktop\Pygame\py.py", line 1, in from p5 import *
File "C:\Users\Anvit\AppData\Local\Programs\Python\Python37\lib\site-packages\p5__init__.py", line 19, in from .sketch import *
File "C:\Users\Anvit\AppData\Local\Programs\Python\Python37\lib\site-packages\p5\sketch__init__.py", line 19, in vispy.use('glfw')
File "C:\Users\Anvit\AppData\Local\Programs\Python\Python37\lib\site-packages\vispy\util\wrappers.py", line 96, in use use_app(app)
File "C:\Users\Anvit\AppData\Local\Programs\Python\Python37\lib\site-packages\vispy\app_default_app.py", line 47, in use_app default_app = Application(backend_name)
File "C:\Users\Anvit\AppData\Local\Programs\Python\Python37\lib\site-packages\vispy\app\application.py", line 49, in __init__ self._use(backend_name)
File "C:\Users\Anvit\AppData\Local\Programs\Python\Python37\lib\site-packages\vispy\app\application.py", line 223, in _use raise RuntimeError(msg)
RuntimeError: Could not import backend "Glfw":
[WinError 193] %1 is not a valid Win32 application

I've been trying to get P5 to work but this error appears no matter what I try. What I've Done

  1. Tried both 64 bit and 32 bit versions of GLFW from the official website. My machine is 64 bit windows 10 and python 3.7.1 64 bit version
  2. Tried to swap the glfw.dll in the python glfw installation with the glfw.dll file obtained from official website.
  3. One other answer recommended to modify glfw.py file such that it imports glfw.dll via absolute path rather than system variable path (Not sure how to do this). I have already added the folder lib-mingw-w64 to the enivronment variable path
Anvit
  • 218
  • 2
  • 12
  • There have been some fixes to vispy in the last 1.5 years since you originally asked this. If this is still something you'd like to accomplish please make a bug report on vispy's github repository. – djhoese Oct 03 '20 at 12:01
  • 1
    @djhose unfortunately I'm not using glfw anymore. As far as I remember two restarts fixed it. One restart did not. it was very weird – Anvit Oct 03 '20 at 12:08

1 Answers1

0

for mac we can install using brew

brew install glfw3
Mukundhan
  • 3,284
  • 23
  • 36