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
  • 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
  • 1 month later...

I tried following these steps but emoji taco and Word Search (syn) are still giving errors. Debug shows "No such file or directory". Help! On an M1 Monterey 12.5.1 with Alfred 5.

 

which python
python: aliased to /usr/bin/python3
/usr/local/bin/python --version
Python 2.7.18
ls -l /usr/local/bin/python
lrwxr-xr-x 1 root wheel 45 2 Sep 12:04 /usr/local/bin/python -> /Users/v/.pyenv/versions/2.7.18/bin/python2.7
/opt/homebrew/bin/python --version
Python 2.7.18
ls -l /opt/homebrew/bin/python --version
ls: --version: No such file or directory
lrwxr-xr-x 1 v admin 45 2 Sep 11:36 /opt/homebrew/bin/python -> /Users/v/.pyenv/versions/2.7.18/bin/python2.7
Link to comment
7 hours ago, vapov said:

python: aliased to /usr/bin/python3

 

That’s the problem. You can’t alias python to python3. The former is supposed to be Python 2.


But none of those Workflows needs these steps. They both have updated version which are linked to in the tables. Download the proper versions: EmojiTaco; WordSearch.

 

7 hours ago, vapov said:

are still giving errors. Debug shows "No such file or directory".

 

For future reports, please make sure to post the exact full errors. It’s not possible to properly help without knowing what exactly is happening.

Link to comment
17 hours ago, vitor said:

 

That’s the problem. You can’t alias python to python3. The former is supposed to be Python 2.


But none of those Workflows needs these steps. They both have updated version which are linked to in the tables. Download the proper versions: EmojiTaco; WordSearch.

 

 

For future reports, please make sure to post the exact full errors. It’s not possible to properly help without knowing what exactly is happening.

 

That worked (switched the alias, downloaded latest – I thought I had the latest).

Thank you!

Link to comment
  • 3 weeks later...

Keep running into errors trying to get Python 2 installed using the command on the help page:

 

macOS 12.5.1

M1 Max MBP

 

$/bin/bash -c "$(curl -fsSL https://github.com/alfredapp/dependency-scripts/raw/main/scripts/install-python2.sh)"


Warning: pyenv 2.3.4 is already installed and up-to-date.
To reinstall 2.3.4, run:
  brew reinstall pyenv
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
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems


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

Inspect or clean up the working tree at /var/folders/kn/1zpbw9s95j77gd2m7g50gyqczjm5nq/T/python-build.20220926213018.13280
Results logged to /var/folders/kn/1zpbw9s95j77gd2m7g50gyqczjm5nq/T/python-build.20220926213018.13280.log

Last 10 log lines:
rm -f /Users/user.name/.pyenv/versions/2.7.18/share/man/man1/python.1
(cd /Users/user.name/.pyenv/versions/2.7.18/share/man/man1; ln -s python2.1 python.1)
if test "xno" != "xno"  ; then \
		case no in \
			upgrade) ensurepip="--upgrade" ;; \
			install|*) ensurepip="" ;; \
		esac; \
		 ./python.exe -E -m ensurepip \
			$ensurepip --root=/ ; \
	fi
ln: /usr/local/bin/python: File exists

 

Has anyone run into this error and found a solution?

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...