Skip to content

[Bug] Stable PyPI release fails on WSL2/Ubuntu with pyglet IndexError due to pyrender dependency #21

@GalahadJr-1214

Description

@GalahadJr-1214

Hello MineStudio Team,

I am attempting to install and run the stable PyPI release of MineStudio on WSL2 (Windows Subsystem for Linux 2) with Ubuntu 24.04, and I'm consistently encountering an IndexError related to pyglet during library initialization.

This issue appears to stem from a dependency conflict where minestudio requires pyrender==0.1.25, which in turn strictly requires pyglet==1.4.0b1.

Description of the Bug:

When attempting to initialize the MineStudio environment (e.g., through the "Hello World" script found here [https://craftjarvis.github.io/MineStudio/simulator/play.html#hello-world]), the application crashes with an IndexError: list index out of range originating from pyglet/gl/glx_info.py.

Steps to Reproduce:

System Environment:

Operating System: Windows 11 (fully updated)

WSL Version: Latest (installed via wsl --install)

WSL Distribution: Ubuntu 24.04 LTS (Noble Numbat)

Conda: Miniconda3 (latest installer)

WSLg: Enabled and fully functional (verified xeyes works, glxinfo reports valid OpenGL/GLX versions).

OpenJDK 8: Installed system-wide via sudo apt install -y openjdk-8-jdk

Conda Environment Setup:

conda create -y -n minestudio python=3.10 pip
conda activate minestudio

pip install minestudio

pip install psutil (identified as a missing dependency)

Rendering Tools Installation (in WSL Ubuntu system):

sudo apt update
sudo apt install -y xvfb mesa-utils libegl1-mesa-dev libgl1-mesa-dev libglu1-mesa-dev

(Note: Original command libegl1-mesa was not found; corrected to libegl1-mesa-dev based on apt search results.)

Error Traceback:

(minestudio) galahad@Chris-NB:~/MineStudio_Test$ python HelloWorld.py
Traceback (most recent call last):
File "/home/galahad/MineStudio_Test/HelloWorld.py", line 7, in
PlayCallback()
File "/home/galahad/miniconda3/envs/minestudio/lib/python3.10/site-packages/minestudio/simulator/callbacks/play.py", line 51, in init
self.gui = MinecraftGUI(extra_draw_call=extra_draw_call)
File "/home/galahad/miniconda3/envs/minestudio/lib/python3.10/site-packages/minestudio/simulator/utils/gui.py", line 166, in init
self.constants = GUIConstants()
File "/home/galahad/miniconda3/envs/minestudio/lib/python3.10/site-packages/minestudio/simulator/utils/constants.py", line 24, in init
import pyglet.window.key as key
File "/home/galahad/miniconda3/envs/minestudio/lib/python3.10/site-packages/pyglet/window/init.py", line 1919, in
gl._create_shadow_window()
File "/home/galahad/miniconda3/envs/minestudio/lib/python3.10/site-packages/pyglet/gl/init.py", line 206, in _create_shadow_window
_shadow_window = Window(width=1, height=1, visible=False)
File "/home/galahad/miniconda3/envs/minestudio/lib/python3.10/site-packages/pyglet/window/xlib/init.py", line 171, in init
super(XlibWindow, self).init(*args, **kwargs)
File "/home/galahad/miniconda3/envs/minestudio/lib/python3.10/site-packages/pyglet/window/init.py", line 601, in init
config = screen.get_best_config(template_config)
File "/home/galahad/miniconda3/envs/minestudio/lib/python3.10/site-packages/pyglet/canvas/base.py", line 192, in get_best_config
configs = self.get_matching_configs(template)
File "/home/galahad/miniconda3/envs/minestudio/lib/python3.10/site-packages/pyglet/canvas/xlib.py", line 220, in get_matching_configs
configs = template.match(canvas)
File "/home/galahad/miniconda3/envs/minestudio/lib/python3.10/site-packages/pyglet/gl/xlib.py", line 58, in match
have_13 = info.have_version(1, 3)
File "/home/galahad/miniconda3/envs/minestudio/lib/python3.10/site-packages/pyglet/gl/glx_info.py", line 86, in have_version
client_version = self.get_client_version().split()[0]
IndexError: list index out of range

Additional Context & Troubleshooting Attempts:

My DISPLAY variable is correctly set (:0).

glxinfo | grep "OpenGL renderer" output: OpenGL renderer string: D3D12 (Intel(R) Arc(TM) Graphics)

glxinfo | grep "GLX version" output: GLX version: 1.4

A basic X application (xeyes) works perfectly on my WSLg setup, confirming general display functionality.

pip freeze within the minestudio environment shows the dependency chain:

minestudio==0.1.0

pyrender==0.1.25 (required by minestudio)

pyglet==1.4.0b1 (required by pyrender)

I attempted to force pip install pyglet==1.5.27 (a stable 1.x release) to address the IndexError. While it installed successfully, pip warned about incompatibility with pyrender 0.1.25 and the IndexError persists, indicating pyrender might not be compatible with pyglet versions beyond 1.4.0b1.

Request for Assistance:

It appears the root cause is the strict dependency of pyrender 0.1.25 on the buggy pyglet 1.4.0b1, which makes the stable MineStudio release unusable on setups like mine. Could you please investigate updating the pyrender dependency, or the pyglet dependency, to a more recent and stable version that resolves this issue?

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