Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 336
Nice-Guy Avatar asked Jan 31 '19 20:01

Nice-Guy


1 Answers

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

like image 64
Nice-Guy Avatar answered Nov 09 '22 12:11

Nice-Guy