PyTouchBar icon indicating copy to clipboard operation
PyTouchBar copied to clipboard

Major Error

Open techpluscraft opened this issue 3 years ago • 1 comments

When installing and running the code you get this error:

  File "/Users/ADMIN/Documents/Mac Tests/controlbar.py", line 2, in <module>
    import PyTouchBar
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PyTouchBar/__init__.py", line 5, in <module>
    from .TouchBar import *
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PyTouchBar/TouchBar.py", line 12, in <module>
    import objc
ModuleNotFoundError: No module named 'objc'

Here is code to replicate

import pygame
import PyTouchBar

pygame.init()

size = width, height = 400,400

screen = pygame.display.set_mode(size) 
PyTouchBar.prepare_pygame()

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            break

techpluscraft avatar Jan 29 '22 17:01 techpluscraft

The patch solution is to run python3 pip install -m pyobjc

SamyBencherif avatar Apr 08 '22 23:04 SamyBencherif