Closed victorchor2868 closed 2 years ago
I guess this workflow is based on Python2 and it is removed in Monterey 12.3.
Since many of my Alfred workflows rely on Python2, I found a workaround to fix the issue.
Users/USER_NAME/.pyenv/versions/VER_NUM/bin/python
, where USER_NAME
is your user name and VER_NUM
is the version number of the installed Python2.pyenv global VER_NUM
Notice that since I don't use pyenv elsewhere, I just change the global python it uses permanently. If you use pyenv elsewhere, you should change it back to system
every time.
Open the workflow folder, make the following change in every python script
# Find this line
cmd = ['/usr/bin/python', ...]
# Replace the python executable with pyenv python
cmd = ['/Users/USER_NAME/.pyenv/versions/VER_NUM/bin/python', ...]
Make the following change in info.plist
# Find this line
/usr/bin/python XXX.py ...
# Replace the python executable with pyenv python command
/opt/homebrew/bin/pyenv exec python XXX.py ...
Change the pyenv path if you don't install it using Homebrew.
Since in steps 3 and 4 you need to change every occurrence of the original python executable, I recommend opening the workflow folder using a text editor like VS Code to do the global search to find all the occurrences.
I'm sorry, I am not a programmer, can I ask you how to do step 2? for step 1, I can't find the binary. will you release a new version for the workflow?
@victorchor2868 I can release a new version, but the problem is the missing python, so you still have to configure the python. Let me give you a step-by-step example for your case.
Install pypy2.7-7.3.6
(an alternative to python):
pyenv install pypy2.7-7.3.6
Set pypy2.7-7.3.6
as global python
pyenv global pypy2.7-7.3.6
Type
which pyenv
make sure the output is /opt/homebrew/bin/pyenv
. Then type
whoami
make sure the output is victorchor
.
In Alfred setting, right-click the Bluetooth manager
tab and choose Open in Finder
, replace the info.plist
with this file: info.txt. Remember to rename this file to info.plist
since GitHub doesn't allow to attach .plist
file.
Go into the workflow
folder, replace the background.py
and workflow.py
with these two files respectively
.txt
to .py
firstThat's all.
It's working, thanks for your explanation. thanks a lot
Fixed in the last release and I leave some notes in the README as well.
I find that switching the default system python to Python 2 (especially after all of this effort to move to Python 3) is counter productive, as it may affect other applications downstream. A better solution would be a) adding a variable to set the python binary, or b) simply setting the python binary in the workflow scripts to /usr/local/bin/python2.7 to specify the python version being used (this worked in my case). This creates less ambiguity and removes the need to override the system python.
well that's why is only recommended if you have updated your os to monterey, otherwise you can use the previous version https://github.com/bmunoz89/alfred-wf-bluetooth-manager/releases/download/2.4.1/Bluetooth.manager.alfredworkflow since there is no new feature it will work in the same way and also your system python should be here /bin/python
and not here /usr/local/bin/python
which is the expected path
Hi,
I want to report an issue, after updating to macOS 12.3, bm, bds, and bcs cannot be found in the Alfred search.