본문 바로가기
생산성/Alfred

macOS Monterey 12.3 업데이트 이후, Alfred 4 workflow에서 발생하는 오류 해결 방법

by Sondho 2022. 4. 14.

원인

macOS 12.3 릴리즈 노트를 확인해보니 12.3 업데이트에서 파이썬 2.7을 macOS에서 제거했다고 합니다.


해결 방법

주의. 모든 workflow가 이 방법으로 해결이 가능한 지는 확인하지 못했습니다.

 

 

1. 아래 명령어를 통해 pyenv를 설치하고 pyenv를 이용하여 python을 설치한다.

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

pyenv global 2.7.18

 

 

2. 작동이 되지 않는 workflow에서 debug 블록을 연결하기 (오른쪽 마우스 -> utilities -> Debug 블록 -> save -> 연결)

 

 

3. 오른쪽 상단의 bug 아이콘 클릭

bug 아이콘

 

 

4. alfred 4 단축키를 이용해서 디버깅 하고 싶은 workflow의 키워드 입력

 

 

5. 아래 사진처럼 Code 127: command not found: python 에러가 뜨면 script를 실행하는 블록에서 python을 찾지 못 했다는 뜻

 

 

6. Script를 실행시켜주는 블록에서 python, /usr/bin/python 등 이 있는 부분을 /Users/<your username>/.pyenv/shims/python으로 변경

변경 전
변경 후

 

 

7. 다시 한 번 키워드를 입력해서 디버깅

 

8. background.py:xxx [Errno 2] No such file or directory 에러가 발생한다면 해당 파일에서 오류가 발생하는 라인(아래 사진을 기준으로 하면 237라인)으로 이동해서 6번과 같은 방법으로 python 경로를 수정


​결론

pyenv를 통해 python 2.7버전을 다운 받고 workflow를 구성하는 코드 중 python이 입력된 경로를 /Users/<your username>/.pyenv/shims/python 으로 수정해준다.


참고 자료

- Alfred Help and Support | Python 2 and macOS Monterey

 

Python 2 Workflows on macOS Monterey - Alfred Help and Support

Python 2 and macOS Monterey Python 2 has now been removed from macOS 12.3, after a decade-long transition period. Workflow developers writing Python mostly switched to version 3, so chances are you won't notice the change. If a workflow you use is affected

www.alfredapp.com

 

- fniephaus/alfred-homebrew |  Issue : Not work in Monterey 12.3 #52

 

Not working in Monterey 12.3 · Issue #52 · fniephaus/alfred-homebrew

Since I have updated to Monterey, I can't get the workflow to work anymore. This is the error I receive: Homebrew & Cask for Alfred[[Script Filter] Queuing argument '' Homebrew &...

github.com

 

- Alfred Help and Support | Using the Workflow Debugger

 

Using the Workflow Debugger - Alfred Help and Support

Using the Workflow Debugger Alfred's Workflows feature includes a debugging tool. When creating workflows that contain scripts, this additional information helps identify what's stopping the workflow from functioning correctly. To use the Debugger, open Al

www.alfredapp.com

 

- Alfred Help and Support | Debugger Utility

 

Debugger Utility - Alfred Help and Support

Debugger Utility The Debug workflow object can be connected to any other object in your workflow. Together with the Debug Viewer, it can help you troubleshoot issues with your workflows' outputs. Clicking on a hyperlinked object will highlight it in the wo

www.alfredapp.com

 

- pyenv 명령어

 

GitHub - pyenv/pyenv: Simple Python version management

Simple Python version management. Contribute to pyenv/pyenv development by creating an account on GitHub.

github.com

 

댓글