Jump to content

Making Python 2 Workflows work on macOS Monterey 12.3 and above


Recommended Posts

18 minutes ago, vitor said:

 


You add PATH; don’t need to change the script shebang unless it’s called without python (rare); update the python library if present; change every reference of /usr/bin/python to python.

Noted, thanks

18 minutes ago, vitor said:

 

There you go. But I won’t add it to the table because it’s a repeat of another. The goal of the repo is not to promote usage of Python 2 Workflows.

 

Thanks. Pls check and re-share the link as above is not working

 

18 minutes ago, vitor said:

As to your other questions, I don’t use Excel or OneDrive so can’t say or test. If you’re finding Workflows which use GUI scripting for the OneDrive app, chances are it doesn’t support proper automation. If they fail to go all the way, you should ask the creators who have already made progress towards the goal. If you find a way to do it programmatically (there might not be one, in which case you need to ask the OneDrive team to implement it), we can help you make it work in a Workflow.

Hoping to get some inputs from other Onedrive or excel expert user. I will also look for similar workflows and reach out to the creators.

Link to comment
22 minutes ago, pankajsz said:

Pls check and re-share the link as above is not working

 

Looks like the Workflow may be having trouble fetching airport data. That’s out of scope for the fixes; they’re being corrected so they work again with Python 2, but any behaviour problems with the Workflow itself have to be reported to the creator.

 

20 minutes ago, pankajsz said:

Is it possible to leave file icon for pdf, excel etc

 

@giovanni You can do that by adding to the Script Filter code:

 

"type": "file",
"icon": {"path": fullT, "type": "fileicon"},

 

Technically you only need the second line, but the first adds other niceties by letting Alfred know it’s a path.

Link to comment
20 minutes ago, vitor said:

 

Looks like the Workflow may be having trouble fetching airport data. That’s out of scope for the fixes; they’re being corrected so they work again with Python 2, but any behaviour problems with the Workflow itself have to be reported to the creator.

 

 

@giovanni You can do that by adding to the Script Filter code:

 

 

"type": "file",
"icon": {"path": fullT, "type": "fileicon"},

 

 

Technically you only need the second line, but the first adds other niceties by letting Alfred know it’s a path.

The link itself for download was not working. But never mind, we can leave it out

Link to comment
6 hours ago, giovanni said:

added in the latest version (thanks @vitor!).

 

this works great. many thanks. Once multiple tags are set, it will be good to add normal file search step similar to dynamic 'ff' workflow. I will also try to do this on my own

Edited by vitor
Moved non-quote text out of quote block
Link to comment
  • 3 weeks later...

I found that Word Search by Isaac Pohl-Zaretsky no longer works for me now. This is one of my most used Workflows so it's a big hit to my productivity and would appreciate your help.

 

I deleted the Workflow and re-installed it via the link provided (https://github.com/jun6lee/Alfred-WordSearch) but the issue persists. I don't know much about coding so I didn't know where to go from there.

 

FYI, I'm using a Mac Mini 2018 with macOS Monterey 12.4 and it has no issues for anything else.

As the previous post showed, when I type "syn" followed by a word, there are no results.

 

I tried re-installing Python 2 but it lead to a whole other error, so I'm not sure what went wrong...

 

I ran it through troubleshooting (before reinstalling Python 2) and this is the result:
 

Quote

 

[18:45:55.217] Word Search[Script Filter] Queuing argument ''
[18:45:55.225] Word Search[Script Filter] Script with argv '(null)' finished
[18:45:55.226] ERROR: Word Search[Script Filter] Code 1: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
[18:45:55.968] Word Search[Script Filter] Queuing argument 'd'
[18:45:56.037] Word Search[Script Filter] Script with argv '(null)' finished
[18:45:56.039] ERROR: Word Search[Script Filter] Code 1: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
[18:45:56.296] Word Search[Script Filter] Queuing argument 'do'
[18:45:56.366] Word Search[Script Filter] Script with argv '(null)' finished
[18:45:56.367] ERROR: Word Search[Script Filter] Code 1: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
[18:45:56.409] Word Search[Script Filter] Queuing argument 'doo'
[18:45:56.478] Word Search[Script Filter] Script with argv '(null)' finished
[18:45:56.479] ERROR: Word Search[Script Filter] Code 1: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
[18:45:56.529] Word Search[Script Filter] Queuing argument 'door'
[18:45:56.533] Word Search[Script Filter] Script with argv '(null)' finished
[18:45:56.535] ERROR: Word Search[Script Filter] Code 1: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

Please let me know how to fix this (bearing in mind I'm naive to coding).

Thanks!

 

 

Link to comment
32 minutes ago, Dey said:

I found that Word Search by Isaac Pohl-Zaretsky no longer works for me now.

 

That one has three alternatives listed on the table.

 

35 minutes ago, Dey said:

I ran it through troubleshooting (before reinstalling Python 2) and this is the result

 

sudo xcode-select --reset in a terminal should fix it.

Link to comment
  • 2 weeks later...
On 3/29/2022 at 8:15 PM, vitor said:

 

Added.

 Is there a better version of this onenote navigator / search available? The current one has limitation on number of database / notebook that are open. Also searching inside the page content does not work in very reliable manner. Thanks in advance for your time and help

Link to comment

Did any of you guys manage to get Python installed on your Monterey machines? It's not working for me. I installed Homebrew, then tried using the provided terminal command to install Python and get this result: 

image.thumb.png.b6f38bff438e15b91c82171bcdf0154a.png

 

Appreciate any help, could love to the get the classic Conv workflow going again. :)

 

 

Link to comment

Thank you so much, that worked a treat. 

 

For completeness, the snippet below is what I used, after installing Homebrew with the snippet from here 

 

export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}"
eval "$(brew shellenv)"
git -C $(brew --repo homebrew/core) checkout master
brew install pyenv
pyenv install 2.7.18
ln -s "${HOME}/.pyenv/versions/2.7.18/bin/python2.7" "${HOMEBREW_PREFIX}/bin/python"

 

Link to comment

Sorry I tried following the instructions, this is the problem:

 

daniele@DanieleMacBookAir2 ~ % export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}"
daniele@DanieleMacBookAir2 ~ % eval "$(brew shellenv)"
daniele@DanieleMacBookAir2 ~ % brew install pyenv
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).

You have 2 outdated casks installed.
You can upgrade them with brew upgrade
or list them with brew outdated.

Warning: pyenv 2.3.2 is already installed and up-to-date.
To reinstall 2.3.2, run:
  brew reinstall pyenv
daniele@DanieleMacBookAir2 ~ % brew uninstall pyenv
Uninstalling /usr/local/Cellar/pyenv/2.3.2... (930 files, 3MB)
daniele@DanieleMacBookAir2 ~ % brew install pyenv  
==> Downloading https://ghcr.io/v2/homebrew/core/pyenv/manifests/2.3.2
Already downloaded: /Users/daniele/Library/Caches/Homebrew/downloads/b8e6be81580ce4b7f6afe34641660ee285c256a7a508dfb64d50bfc06b90d5b9--pyenv-2.3.2.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/pyenv/blobs/sha256:b37a5d64282152f2af9c63d2dbcd25f4ba2a3fa85decdbc2863dbd453a312658
Already downloaded: /Users/daniele/Library/Caches/Homebrew/downloads/a2da35c7c036aa53d0078cef157147d380bce4a6299426c5a8054237e487365e--pyenv--2.3.2.monterey.bottle.tar.gz
==> Pouring pyenv--2.3.2.monterey.bottle.tar.gz
🍺  /usr/local/Cellar/pyenv/2.3.2: 930 files, 3MB
==> Running `brew cleanup pyenv`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
daniele@DanieleMacBookAir2 ~ % pyenv install 2.7.18
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-2.7.18.tar.xz...
-> https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xz
Installing Python-2.7.18...
patching file configure
patching file configure.ac
patching file setup.py
patching file Mac/Tools/pythonw.c
patching file setup.py
patching file Doc/library/ctypes.rst
patching file Lib/test/test_str.py
patching file Lib/test/test_unicode.py
patching file Modules/_ctypes/_ctypes.c
patching file Modules/_ctypes/callproc.c
patching file Modules/_ctypes/ctypes.h
patching file Modules/_ctypes/callproc.c
patching file setup.py
patching file Mac/Modules/qt/setup.py
patching file setup.py
python-build: use tcl-tk from homebrew
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

BUILD FAILED (OS X 12.4 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/2z/smkrnfs54xvgyf05htq8xh680000gn/T/python-build.20220720163156.5009
Results logged to /var/folders/2z/smkrnfs54xvgyf05htq8xh680000gn/T/python-build.20220720163156.5009.log

Last 10 log lines:
checking MACHDEP... darwin
checking EXTRAPLATDIR... $(PLATMACDIRS)
checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/var/folders/2z/smkrnfs54xvgyf05htq8xh680000gn/T/python-build.20220720163156.5009/Python-2.7.18':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.

 

I also tried to delete all as you suggested previously, but it doesn't work:

 

daniele@DanieleMacBookAir2 ~ % export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}"
daniele@DanieleMacBookAir2 ~ % eval "$(brew shellenv)"
daniele@DanieleMacBookAir2 ~ % osascript -e "tell application \"Finder\" to delete (POSIX file \"${HOME}/.pyenv\")"
29:72: execution error: Finder got an error: Handler can’t handle objects of this class. (-10010)
daniele@DanieleMacBookAir2 ~ % osascript -e "tell application \"Finder\" to delete (POSIX file \"${HOMEBREW_PREFIX}/bin/python\")"
29:72: execution error: Finder got an error: Handler can’t handle objects of this class. (-10010)
daniele@DanieleMacBookAir2 ~ % 

 

Can I download Python here instead? https://www.python.org/downloads/release/python-2718/

 

After the installation Python is here:

 

daniele@DanieleMacBookAir2 ~ % which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python

 

Please help me thanks.

 

Edited by Daniele
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...