Skip to content

Update macOS installation instructions to recommend ⁠pipx (PEP 668 compatibility) #39

@delmicio

Description

@delmicio

The current macOS installation instructions fail when using Homebrew-managed Python environments due to PEP 668. Modern macOS/Homebrew Python installations prevent global pip installs to avoid breaking the system environment, resulting in the externally-managed-environment error.

Steps to Reproduce / The Error

Running the standard install command:

pip3 install -U cocoindex-code

Yields the following error:

error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try brew install...
    If you wish to install a Python library... use a virtual environment...
    it may be easiest to use 'pipx install xyz'...

Proposed Solution

I successfully resolved this by using pipx, which is now the industry standard for installing Python-based CLIs globally without conflicting with the system Python.

I suggest updating the README.md for macOS users to include the following steps:

# Install pipx if you haven't already
brew install pipx

# Install cocoindex-code
pipx install cocoindex-code

Verification

Using pipx successfully installs the package and makes the binary globally available:

installed package cocoindex-code 0.1.9, installed using Python 3.14.x
These apps are now globally available
  - cocoindex-code
done! ✨ 🌟 ✨

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions