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

For anyone still using this after macOS 12.3 #18

Open
0x-2a opened this issue Mar 17, 2022 · 5 comments
Open

For anyone still using this after macOS 12.3 #18

0x-2a opened this issue Mar 17, 2022 · 5 comments

Comments

@0x-2a
Copy link

0x-2a commented Mar 17, 2022

Apple removed the system python 2. I use this workflow all the time and needed to bring it back. Here's what I did.

First get python 2 back

# Download/run the legacy macOS installer (pick which one for your sys)
https://www.python.org/downloads/release/python-2716/

# Add pip for python2.7
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip2.py
python2 get-pip2.py

# Add the missing macos plist lib alfred uses
curl https://raw.githubusercontent.com/python/cpython/2.7/Lib/plistlib.py -o /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py

# Add missing pip for this workflow
python2 -m pip install delorean

# Optionally add the helpers like easy_install back onto your path
# In your ~/.zprofile or whatever bash/shell profile equivalent
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

Now open alfred preferences > Workflows > double click on the script filter square in the workflow GUI
Update the script filter to one of the two below.

If which python shows 2.7

/usr/local/bin/python process.py "{query}"

If which python shows 3...

/usr/local/bin/python2 process.py "{query}"

For more legacy python2 help I wrote an SO post: https://stackoverflow.com/a/71513250/786389

@philotas
Copy link

I used pyenv to install python 2.7 now using:
/Users/username/.pyenv/versions/2.7.18/bin/python2.7 process.py "{query}"

works. Before I linked to a python2 version which was installed with MAMP, but that did not work.

Anyway, thanks for the tip!

@polym
Copy link

polym commented May 18, 2022

@philotas thx, it works. More details are below:

  1. Install pyenv and python2.7
brew install pyenv
pyenv install 2.7.18
  1. Change the script to
$HOME/.pyenv/versions/2.7.18/bin/python2.7 process.py "{query}"

@alexmerkel
Copy link

I created a Python 3 compatible fork here:
https://github.com/alexmerkel/alfred-datetime-format-converter

@HQCND
Copy link

HQCND commented Jul 14, 2022

I created a Python 3 compatible fork here: https://github.com/alexmerkel/alfred-datetime-format-converter

Can you supported millisecond level and add a default date time about UTC time zone when used other time zones? Thank you so much

@alexmerkel
Copy link

Thanks to a pull request by @fg6a5gf this functionality is added now.

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

No branches or pull requests

5 participants