qmk/qmk_firmware

[Bug] Get AttributeError: module 'numpy.typing' has no attribute 'ndarray' when following base tutorial on Mac OSX 14.6.1

Open

#24.547 geöffnet am 30. Okt. 2024

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C (43.867 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (20.368 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 20T 9h) (27 gemergte PRs in 30 T)

Beschreibung

Describe the Bug

I am trying to follow the base tutorial. I install QMK with Brew and when I try to run qmk setup (or qmk setup gregeporter/qmk_firmware

I get the following error

(qmk) gregeporter@Gregorys-MacBook-Pro ~ % qmk setup Traceback (most recent call last): File "/usr/local/bin/qmk", line 8, in sys.exit(main()) ~~~~^^ File "/usr/local/Cellar/qmk/1.1.5_2/libexec/lib/python3.13/site-packages/qmk_cli/script_qmk.py", line 76, in main import qmk.cli # noqa ^^^^^^^^^^^^^^ File "/Users/gregeporter/qmk_firmware/lib/python/qmk/cli/init.py", line 257, in import(subcommand) ~~~~~~~~~~^^^^^^^^^^^^ File "/Users/gregeporter/qmk_firmware/lib/python/qmk/cli/painter/init.py", line 1, in from . import convert_graphics File "/Users/gregeporter/qmk_firmware/lib/python/qmk/cli/painter/convert_graphics.py", line 5, in from qmk.painter import generate_subs, render_header, render_source, valid_formats File "/Users/gregeporter/qmk_firmware/lib/python/qmk/painter.py", line 7, in from PIL import Image, ImageOps File "/usr/local/Cellar/qmk/1.1.5_2/libexec/lib/python3.13/site-packages/PIL/Image.py", line 68, in from ._typing import StrOrBytesPath, TypeGuard File "/usr/local/Cellar/qmk/1.1.5_2/libexec/lib/python3.13/site-packages/PIL/_typing.py", line 12, in NumpyArray = npt.ndarray[Any] ^^^^^^^^^^^ AttributeError: module 'numpy.typing' has no attribute 'ndarray'

I tried to install numpy manually and made a new conda environment with python version 3.13.

I looked into /usr/local/Cellar/qmk/1.1.5_2/libexec/lib/python3.13/site-packages/PIL/_typing.py and see the check that is causing the error.

I followed these steps to get the version of numpy and print it to the console before the offending assignment. The result was None.

So I just commented out Line 10 - NumpyArray = npt.ndarray[Any] and ran qmk setup and it worked!

Is this a bug?

Keyboard Used

No response

Link to product page (if applicable)

No response

Operating System

OSX 14.6.1

qmk doctor Output

Same error as above:

Traceback (most recent call last):
  File "/usr/local/bin/qmk", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/local/Cellar/qmk/1.1.5_2/libexec/lib/python3.13/site-packages/qmk_cli/script_qmk.py", line 76, in main
    import qmk.cli  # noqa
    ^^^^^^^^^^^^^^
  File "/Users/gregeporter/qmk_firmware/lib/python/qmk/cli/__init__.py", line 257, in <module>
    __import__(subcommand)
    ~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/gregeporter/qmk_firmware/lib/python/qmk/cli/painter/__init__.py", line 1, in <module>
    from . import convert_graphics
  File "/Users/gregeporter/qmk_firmware/lib/python/qmk/cli/painter/convert_graphics.py", line 5, in <module>
    from qmk.painter import generate_subs, render_header, render_source, valid_formats
  File "/Users/gregeporter/qmk_firmware/lib/python/qmk/painter.py", line 7, in <module>
    from PIL import Image, ImageOps
  File "/usr/local/Cellar/qmk/1.1.5_2/libexec/lib/python3.13/site-packages/PIL/Image.py", line 68, in <module>
    from ._typing import StrOrBytesPath, TypeGuard
  File "/usr/local/Cellar/qmk/1.1.5_2/libexec/lib/python3.13/site-packages/PIL/_typing.py", line 12, in <module>
    NumpyArray = npt.ndarray[Any]
                 ^^^^^^^^^^^
AttributeError: module 'numpy.typing' has no attribute 'ndarray'

Is AutoHotKey / Karabiner installed

  • AutoHotKey (Windows)
  • Karabiner (macOS)

Other keyboard-related software installed

No response

Additional Context

No response

Contributor Guide