Skip to content

pip install installs to wrong environment on macOS with Homebrew #1

@arilamstein

Description

@arilamstein

The Set Up Environment Variables section of the README has this code:

cd backend
pip install -r requirements.txt

On Macs where python3 is managed by Homebrew, this leads to unexpected behavior. Homebrew intentionally takes over the python3 command but does not take over pip. As a result, the above command installs packages into the system Python environment, not the one invoked by python3:

~ which pip
/usr/local/bin/pip
➜  ~ which python3
/opt/homebrew/bin/python3

This mismatch caused bugs that prevented me from completing the workshop.

One possible fix is to recommend creating a virtual environment and using:

python3 -m pip install -r requirements.txt`

In my own workshops I've started using uv to simplify setup. After cloning the repo, students run:

uv sync

This creates a virtual environment with the same Python version and package versions I used when altering the tutorial. Example: Streamlit Tutorial Setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions