I'm using Mac OS Tahoe 26.1 on my MacBook Pro M1, and ever since the update, I've been unable to create a Python virtual environment. When I run `python3.13 -m venv my_env` as a regular user, I encounter this error: `Error: Command '['/my_env/bin/python3.13', '-m', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1`. I've tried searching for a solution but haven't found anything useful. As a temporary workaround, I have to use sudo to create the virtual environment and then change the folder ownership back to my regular user. I'm curious why a non-admin user can't create a venv in their own directory, but this workaround works for now, even if it's a bit clunky.
4 Answers
I was dealing with some venv issues too, and it seems like my environment changed recently after an update. You're definitely not alone in this!
First, make sure your pip is updated by running `pip install --upgrade pip`. You shouldn't need to use sudo to create virtual environments at all. Just try running `python3 -m venv nameofproject` again and let us know the outcome.
You might want to try not using sudo and see if you can clean up any old venvs. It seems like you might be trying to create a venv from within another one, which can cause issues.
How did you install Python? If you used Homebrew, it should work fine on Tahoe. Just wondering if the installation might be the issue.

Yeah, I installed it via Homebrew too. Maybe I messed up something in the configuration.