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 aperta il 30 ott 2024

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)C (43.867 fork)batch import
bughelp wanted

Metriche repository

Star
 (20.368 star)
Metriche merge PR
 (Merge medio 20g 9h) (27 PR mergiate in 30 g)

Descrizione

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

Guida contributor