benknight / hue-alfred-workflow

An Alfred workflow for controlling Philips Hue lights.
367 stars 34 forks source link

Update /usr/bin/python to /usr/local/bin/python #65

Closed zachmccormick closed 1 year ago

zachmccormick commented 2 years ago

This should help folks who had to do

pyenv install 2.7.18
ln -s "${HOME}/.pyenv/versions/2.7.18/bin/python2.7" "/usr/local/bin/python"

to get python2 back on their machine. The plist file needs to be updated to point to /usr/local/bin/python as well.

zachmccormick commented 2 years ago

Really the better option is probably to use /usr/bin/env python, but that'll be python3 for Monterey. I could probably fix this to be python3 compatible and use /usr/bin/env python where it should work for both 2/3 if you'd rather merge that change.

benknight commented 2 years ago

Hey @zachmccormick sorry for the delayed response.

At this point I prefer shipping a complete fix without any user–installed dependencies. In other words the I need a Python 3 compatible version or fork of https://github.com/deanishe/alfred-workflow

In the mean time users will have to manually follow instructions to get this working on Python 2: https://www.alfredapp.com/help/kb/python-2-monterey/

zachmccormick commented 2 years ago

No worries! Next time it breaks on me I'll spend the time and make it work with python3 then if no one else has :)

benknight commented 2 years ago

@zachmccormick actually would you be willing to do the Python 3 upgrade? I don't currently have a Philip Hue system in my possession so attempting to do the migration myself would be futile since there's no way I could be sure all the features worked.

There's guy has already forked the Alfred-Workflow Python package and added support for Python 3. It looks like he's set to publish it soon and the Alfred community will officially recommend his fork for Python-based workflows going forward.

See this comment: https://github.com/deanishe/alfred-workflow/issues/97#issuecomment-1120290043

There he describes were to pull the most recent copy of the source.

While you're add it, if you wanted to, you could also replace the colorpicker functionality which depends on PHP.