virtualenvpython-3.7

Cannot Create Python Virtual Environment on Mac OS Mojave


Whenever I run python3 -m venv venv I get this error. I don't get this error on my Mac that is the version behind Mojave. I'm not sure what the issue is, and the error text is very brief:

Error: Command /Users/marcus/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' died with <Signals.SIGABRT: 6>.

Operating System: Mac OS 10.14.3

Python Version: 3.7.2

Blood Pressure: high


Solution

  • I realized after staring at the line for so long that it was complaining mostly about pip and that this was probably caused by Mac OS X's system pip, which is protected.

    My venv came alive with the without pip flags like so: python3 -m venv venv --without-pip.

    here's what works for me the best:

    virtualenv -p python3 venv && source venv/bin/activate