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! ✨ 🌟 ✨
The current macOS installation instructions fail when using Homebrew-managed Python environments due to PEP 668. Modern macOS/Homebrew Python installations prevent global
pipinstalls to avoid breaking the system environment, resulting in theexternally-managed-environmenterror.Steps to Reproduce / The Error
Running the standard install command:
Yields the following error:
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.mdfor macOS users to include the following steps:Verification
Using
pipxsuccessfully installs the package and makes the binary globally available: