Page 1 of 1

Pyglet su Raspberry Ri 2

Posted: Wed Jul 31, 2019 4:37 pm
by Lollo56
Salve, sto cercando di creare un tachimetro digitale utilizzando la libreria Pyglet (Sto usando pyglet perché è l'unica libreria che ho trovato che supporta le immagini in png(Ad esempio Tkinter carica anche uno sfondo bianco nella parte in cui dovrebbe essere trasparente) e le animazioni). Il mio problema è che quando faccio partire il codice su Raspberry mi da questo errore:

Code: Select all

Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/pyglet/__init__.py", line 352, in __getattr__
    return getattr(self._module, name)
AttributeError: 'NoneType' object has no attribute 'add_file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "grafica.py", line 16, in <module>
    pyglet.font.add_file('digital-7.ttf')
  File "/home/pi/.local/lib/python3.7/site-packages/pyglet/__init__.py", line 358, in __getattr__
    __import__(import_name)
  File "/home/pi/.local/lib/python3.7/site-packages/pyglet/font/__init__.py", line 73, in <module>
    from pyglet.font.freetype import FreeTypeFont
  File "/home/pi/.local/lib/python3.7/site-packages/pyglet/font/freetype.py", line 42, in <module>
    from pyglet.font import base
  File "/home/pi/.local/lib/python3.7/site-packages/pyglet/font/base.py", line 53, in <module>
    from pyglet.gl import *
  File "/home/pi/.local/lib/python3.7/site-packages/pyglet/gl/__init__.py", line 237, in <module>
    import pyglet.window
  File "/home/pi/.local/lib/python3.7/site-packages/pyglet/window/__init__.py", line 1871, in <module>
    gl._create_shadow_window()
  File "/home/pi/.local/lib/python3.7/site-packages/pyglet/gl/__init__.py", line 209, in _create_shadow_window
    _shadow_window = Window(width=1, height=1, visible=False)
  File "/home/pi/.local/lib/python3.7/site-packages/pyglet/window/xlib/__init__.py", line 171, in __init__
    super(XlibWindow, self).__init__(*args, **kwargs)
  File "/home/pi/.local/lib/python3.7/site-packages/pyglet/window/__init__.py", line 641, in __init__
    self._create()
  File "/home/pi/.local/lib/python3.7/site-packages/pyglet/window/xlib/__init__.py", line 265, in _create
    self.context.set_vsync(self._vsync) # XXX ?
  File "/home/pi/.local/lib/python3.7/site-packages/pyglet/gl/xlib.py", line 255, in set_vsync
    glxext_mesa.glXSwapIntervalMESA(interval)
  File "/home/pi/.local/lib/python3.7/site-packages/pyglet/gl/lib.py", line 64, in MissingFunction
    raise MissingFunctionException(name, requires, suggestions)
pyglet.gl.lib.MissingFunctionException: glXSwapIntervalMESA is not exported by the available OpenGL driver.  MESA_swap_control is required for this functionality.
Errore di segmentazione
La cosa strana è che mi da questo errore solo quando i driver openGL di raspberry sono attivi, infatti quando li disattivo, il programma si avvia con però problemi di prestazioni. La cosa ancora più strana è che quando avvio 'glxinfo' con i driver openGL disattivati, mi viene scritto: GL_VERSION = 3.1
Tutto ciò mi fa pensare ad un problema di driver openGL, ma ho visto alcuni che fanno girare minecraft su Raspberry, quindi mi sembra molto strano che minecraft funzioni e pyglet no.
Qualche soluzione a questo problema?