Issue
I am trying to use virtualenv to create a virtual python environment on my mac. I have downloaded virtualenv however I can't run it because it can't find the path to my installation of python3 even though I am supplying the correct path. Here is the command I have run and the response:
virtualenv --python=/usr/local/bin/python3 newfolder
zsh: /usr/local/bin/virtualenv: bad interpreter: /usr/local/opt/python3/bin/python3.6: no such file or directory
Also I have tried running the command with quotes like so:
virtualenv --python='/usr/local/bin/python3' newfolder
zsh: /usr/local/bin/virtualenv: bad interpreter: /usr/local/opt/python3/bin/python3.6: no such file or directory
Please note I am supplying the correct path to python3 as far as I can tell.
Here is what I get when I run which python3
which python3
/usr/local/bin/python3
Also virtualenv appears to be correctly installed. Here is evidence for this:
pip3 install virtualenv
Requirement already satisfied: virtualenv in /Users/mathewlewis/Library/Python/3.7/lib/python/site-packages (16.7.9)
Also, in case this is relevant, the software I have is currently mac os catalina 10.15.2
Not only would I like a solution (as has been given at this point) I would also like a reason why this didn't work.
Solution
Try:
python3 -m venv venv
source ./venv/bin/activate
Answered By - aminrd Answer Checked By - Clifford M. (WPSolving Volunteer)