❤️💻 Macbook Pro's Touch Bar is finally useful: displaying sensors and controlling devices

I also have big problems configuring the touch bar

i get the following error message:

Traceback (most recent call last):
  File "/Users/karstenthiemann/Downloads/home-assistant-macbook-touch-bar-master/widgets/switch.py", line 9, in <module>
    from utils import entity, icon_folder, service
  File "/Users/karstenthiemann/Downloads/home-assistant-macbook-touch-bar-master/widgets/utils.py", line 4, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

but the files are all included?

try:

pip install requests
# or
sudo pip install requests

see ❤️💻 Macbook Pro's Touch Bar is finally useful: displaying sensors and controlling devices - #16 by basnijholt

I have the following error returning in Better touch tool:

Traceback (most recent call last):
  File "/Users/koencramer/Downloads/home-assistant-macbook-touch-bar-master/widgets/switch.py", line 9, in <module>
    from utils import entity, icon_folder, service
  File "/Users/koencramer/Downloads/home-assistant-macbook-touch-bar-master/widgets/utils.py", line 9
    "Authorization": f"Bearer {token}",
                                     ^
SyntaxError: invalid syntax

“sudo pip install requests” returns in Terminal:

Requirement already satisfied: requests in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (2.25.1)
Requirement already satisfied: idna<3,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from requests) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from requests) (2021.5.30)
Requirement already satisfied: chardet<5,>=3.0.2 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from requests) (4.0.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from requests) (1.26.5)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

How can I get this to work?

Picture:

It seems like you are executing the Python script with an older Python version.

You are using /usr/bin/python in the Script:" field, replace it with /usr/bin/python3.9.

Or type sudo which python and see what the correct Python path is.\

Perhaps it is /usr/local/bin/python.

It works for a couple of seconds when it gets replaced by:

/bin/bash: /usr/bin/python3.9: No such file or directory

and

/bin/bash: /usr/local/bin/python: No such file or directory

“sudo which python” returns:

/usr/bin/python

Should I update to a newer Python version?

@basnijholt

Can you please help me? When I run it I get this error:

/bin/bash: /Users/davidnestico/usr/bin/python3: No such file or directory
It appears I have the default “python3” installed because “which python” in terminal shows nothing, but “which python3” does show a file path.

Another thing is I have no idea how to do the light slider, no idea where the code has to go.

It’s probably super simple I just can’t figure it out right now.