Skip to content

Commit 9a4895c

Browse files
committed
Fix pip install failing under Homebrew Python (PEP 668)
Homebrew Python 3.12+ blocks pip install outside a venv. The action was trying to upgrade pip before creating the venv, causing the externally-managed-environment error. Create venv first, then upgrade pip inside it. Also drop OrderedDict which is a built-in since Python 3.1.
1 parent 1d0fff3 commit 9a4895c

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

.github/actions/install-macos-deps/action.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,20 @@ runs:
4545
run: |
4646
echo "Installing Python packages for PCP..."
4747
python3 --version
48-
pip3 --version
49-
pip3 install --upgrade pip
5048
51-
# Create venv for build dependencies
49+
# Homebrew Python 3.12+ blocks pip install outside a venv (PEP 668).
50+
# Create the venv first, then do everything inside it.
5251
python3 -m venv pybuilddeps
5352
source pybuilddeps/bin/activate
5453
54+
pip3 install --upgrade pip
5555
pip3 install setuptools wheel
5656
python3 -c "import setuptools; print('setuptools version:', setuptools.__version__)"
5757
5858
# Install PCP Python dependencies
5959
python3 -m pip install \
6060
lxml \
6161
openpyxl \
62-
OrderedDict \
6362
psycopg2-binary \
6463
prometheus_client \
6564
pyarrow \

0 commit comments

Comments
 (0)