Skip to content

live2d-py 0.6.1.1 下使用live2d.v2尝试运行样例代码'main_pygame_simple.py'报错 #130

Description

@NERVWORLD

平台(如 windows 11,x64):

Windows 11 Pro 25H2 (26200.8117) x64

CPU: AMD Ryzen 7 5800H with Radeon Graphics (3.20 GHz)
核显: AMD Radeon(TM) Graphics (497 MB)

python 版本(精确到子版本和位数,如 3.10.11 win32):

Python 3.11.9, amd64

live2d-py 版本(如 0.3.1):

0.6.1.1

live2d 模型版本(live2d.v2 或 live2d.v3):

live2d.v2

问题描述

pygame 2.6.1 (SDL 2.28.4, Python 3.11.9)
Hello from the pygame community. https://www.pygame.org/contribute.html
_L0 to compile shader : b'Fragment shader failed to compile with the following errors:\nERROR: 0:2: error(#263) "Precision qualifier" is not supported prior to GLSL version 1.30\nERROR: error(#273) 1 compilation errors.  No code generated\n\n'
Fragment shader compile li_!
Traceback (most recent call last):
  File "C:\Users\Kotone\AppData\Local\Programs\Python\Python311\Lib\runpy.py", line 198, in _run_module_as_main
    return _run_code(code, main_globals, None,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Kotone\AppData\Local\Programs\Python\Python311\Lib\runpy.py", line 88, in _run_code
    exec(code, run_globals)
  File "c:\Users\Kotone\.vscode\extensions\ms-python.debugpy-2025.18.0-win32-x64\bundled\libs\debugpy\launcher/../..\debugpy\__main__.py", line 71, in <module>
    cli.main()
  File "c:\Users\Kotone\.vscode\extensions\ms-python.debugpy-2025.18.0-win32-x64\bundled\libs\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 508, in main
    run()
  File "c:\Users\Kotone\.vscode\extensions\ms-python.debugpy-2025.18.0-win32-x64\bundled\libs\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 358, in run_file
    runpy.run_path(target, run_name="__main__")
  File "c:\Users\Kotone\.vscode\extensions\ms-python.debugpy-2025.18.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 310, in run_path
    return _run_module_code(code, init_globals, run_name, pkg_name=pkg_name, script_name=fname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Kotone\.vscode\extensions\ms-python.debugpy-2025.18.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 127, in _run_module_code
    _run_code(code, mod_globals, init_globals, mod_name, mod_spec, pkg_name, script_name)
  File "c:\Users\Kotone\.vscode\extensions\ms-python.debugpy-2025.18.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 118, in _run_code
    exec(code, run_globals)
  File "D:\CustomAssitant\main_pygame_simple.py", line 70, in <module>
    main()
  File "D:\CustomAssitant\main_pygame_simple.py", line 61, in main
    model.Draw()
  File "d:\CustomAssitant\.venv\Lib\site-packages\live2d\v2\lapp_model.py", line 276, in Draw
    self.live2DModel.update()
  File "d:\CustomAssitant\.venv\Lib\site-packages\live2d\v2\core\live2d_model_opengl.py", line 16, in update
    self.modelContext.preDraw(self.drawParamGL)
  File "d:\CustomAssitant\.venv\Lib\site-packages\live2d\v2\core\model_context.py", line 226, in preDraw
    aH.setupDraw()
  File "d:\CustomAssitant\.venv\Lib\site-packages\live2d\v2\core\graphics\draw_param_opengl.py", line 131, in setupDraw
    self.initShader()
  File "d:\CustomAssitant\.venv\Lib\site-packages\live2d\v2\core\graphics\draw_param_opengl.py", line 284, in initShader
    self.a_position_Loc = aH.getAttribLocation(self.shaderProgram, "a_position")
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\CustomAssitant\.venv\Lib\site-packages\live2d\v2\core\live2d_gl_wrapper.py", line 66, in getAttribLocation
    return gl.glGetAttribLocation(program, name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\CustomAssitant\.venv\Lib\site-packages\OpenGL\latebind.py", line 63, in __call__
    return self.wrapperFunction( self.baseFunction, *args, **named )
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\CustomAssitant\.venv\Lib\site-packages\OpenGL\GL\VERSION\GL_2_0.py", line 480, in glGetAttribLocation
    return baseOperation(program, name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\CustomAssitant\.venv\Lib\site-packages\OpenGL\platform\baseplatform.py", line 487, in __call__
    return self(*args, **named)
           ^^^^^^^^^^^^^^^^^^^^
  File "d:\CustomAssitant\.venv\Lib\site-packages\OpenGL\error.py", line 230, in glCheckError
    raise self._errorClass(
OpenGL.error.GLError: GLError(
        err = 1282,
        description = b'\x96\xb3\x8c\xf8\x82\xc8\x91\x80\x8d\xec',
        baseOperation = glGetAttribLocation,
        cArguments = (1, b'a_position\x00'),
        result = -1
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions