Python venv command failing on MacOS with Homebrew

1 week ago 13
ARTICLE AD BOX

I've been happily using python with venv for at least the last year. It now no longer works:

python -m venv .

returns the error:

Error: Command '['/Users/sejaques/bin/python3.13', '-m', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

Specifically using python3 gives the same error, just with the latest version of python:

python3 -m venv .

Error: Command '['/Users/sejaques/bin/python3.14', '-m', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

Other questions about this issue in Ubuntu suggest upgrading venv itself, but I don't know how to do that with Homebrew.

I thought it might be a homebrew/system mismatch issue: Brew thinks I have Python3.14 but python -V returns 3.13. But python3 -V returns 3.14 and as noted above this fails as well. The answer here notes some methods to make the versions consistent and (ironically) recommends using virtual environments.

Other questions suggest that this means venv is not installed at all. I'm not sure how to fix that if that is the case, since I can only install packages within virtual environments or with Homebrew, and I can't find venv through Homebrew.

Read Entire Article