Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks
GregePorter opened this issue Oct 30, 2024 · 0 comments

Comments

@GregePorter
Copy link

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'
Screenshot 2024-10-29 at 9 52 57 PM

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

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

No branches or pull requests

1 participant