Full Guide to Using Python with Keyboard Maestro

:watch: Chapters:

How I Stopped Doing Boring Work 00:00

Automation Examples 00:32

Python Setup 01:55

Automation #1 09:45

Enhancing Automation #1 22:59

Automation #2 26:08

9 Likes

Thank you for this clear video, which explains everything very well. However, I do have one question: what risks am I taking by running the ‘1: Install Python and Create Scripts Folder’ macro if I already have Homebrew and Python installed on my Mac?

1 Like

From ChatGPT:

  1. It may change which python/python3 you use.
    brew install python installs/links Homebrew’s latest Python (e.g., 3.x). This can shadow any Python from python.org, Conda, pyenv, Xcode, or an older Homebrew Python. Existing virtualenvs tied to an older minor version can break.
  2. It updates Homebrew itself.
    brew update fetches the newest Homebrew/core definitions; subsequent installs may also upgrade dependencies. This can cascade into newer Python and libraries than you expect.
  3. It permanently edits your shell profile.
    It appends eval "$($(brew --prefix)/bin/brew shellenv)" to ~/.bash_profile or ~/.zprofile. That:
    • Persists PATH/HOMEBREW_* changes for every future shell.

    • Can reorder PATH so Homebrew tools (including Python) take precedence.

    • Touches only one file (bash or zsh) based on what’s running now; if you use multiple shells, behavior may differ.

  4. Dual-Homebrew confusion risk.
    If you have both /opt/homebrew (ARM) and /usr/local (Intel) installs present, it evals both shellenv blocks in this session. The last one wins, possibly pointing you to the “wrong” arch prefix for the remainder of the script/shell.
  5. Potential conflicts with Conda/pyenv.
    Adding Homebrew’s shellenv first in PATH can override Conda/pyenv shims, breaking expected environments/versions.