Skip to content

Improved compatibility. (fix Windows < 8.1 has no shcore library error) #1401

@thefatwhale

Description

@thefatwhale

Describe the bug
Happy new year!

I'm using pyglet==2.1.11 on my Spare old computer.
running on Windows 7 x64 SP1. with Python 3.8.
but raise a exception like this.

FileNotFoundError: Could not find module 'shcore' (or one of its dependencies). Try using the full path with constructor syntax.

full exception here...

Traceback (most recent call last):
  File "C:\Users\Mycelium\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Mycelium\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\MyProject\Python\manim-learn\.venv\Scripts\manimgl.exe\__main__.py", line 4, in <module>
  File "d:\myproject\python\manim-learn\.venv\lib\site-packages\manimlib\__init__.py", line 23, in <module>
    from manimlib.window import *
  File "d:\myproject\python\manim-learn\.venv\lib\site-packages\manimlib\window.py", line 5, in <module>
    from moderngl_window.context.pyglet.window import Window as PygletWindow
  File "d:\myproject\python\manim-learn\.venv\lib\site-packages\moderngl_window\context\pyglet\__init__.py", line 1, in <module>
    from .keys import Keys  # noqa
  File "d:\myproject\python\manim-learn\.venv\lib\site-packages\moderngl_window\context\pyglet\keys.py", line 12, in <module>
    from pyglet.window import key
  File "d:\myproject\python\manim-learn\.venv\lib\site-packages\pyglet\window\__init__.py", line 102, in <module>
    from pyglet.graphics import shader
  File "d:\myproject\python\manim-learn\.venv\lib\site-packages\pyglet\graphics\__init__.py", line 16, in <module>
    from pyglet.gl.gl import (
  File "d:\myproject\python\manim-learn\.venv\lib\site-packages\pyglet\gl\__init__.py", line 192, in <module>
    from .win32 import Win32Config as Config
  File "d:\myproject\python\manim-learn\.venv\lib\site-packages\pyglet\gl\win32.py", line 6, in <module>
    from pyglet.display.win32 import Win32Canvas
  File "d:\myproject\python\manim-learn\.venv\lib\site-packages\pyglet\display\__init__.py", line 44, in <module>
    from pyglet.display.win32 import Win32Display as Display
  File "d:\myproject\python\manim-learn\.venv\lib\site-packages\pyglet\display\win32.py", line 7, in <module>
    from pyglet.libs.win32 import _gdi32, _shcore, _user32
  File "d:\myproject\python\manim-learn\.venv\lib\site-packages\pyglet\libs\win32\__init__.py", line 25, in <module>
    _shcore = DebugLibrary('shcore')
  File "d:\myproject\python\manim-learn\.venv\lib\site-packages\pyglet\libs\win32\__init__.py", line 16, in <lambda>
    DebugLibrary = lambda lib: ctypes.WinDLL(lib, use_last_error=True if _debug_win32 else False)
  File "C:\Users\Mycelium\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'shcore' (or one of its dependencies). Try using the full path with constructor syntax.

System Information:
OS: Windows 7 x64 SP1
Python: 3.8.6
pyglet: 2.1.11

How To Reproduce
Install manimgl and run it on windows 7.
https://github.com/3b1b/manim

REM create virtual env
python -m venv .venv

REM activate env
.\.venv\Scripts\activate

REM install manim
pip3 install manimgl

REM run manim
manimgl

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions