You've probably already done this, or it came with the stock macbook:
$ brew install python
$ python3 --version
Python 3.7.3
$ python --version
Python 2.7.16
brew unlink python
brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
python3 get-pip.py
To install virtualenv via pip run:
pip3 install virtualenv
Creation of virtualenv:
cd ~/your_project
ln -s /usr/local/Cellar/python/3.6.5_1/bin/python3.6 python3.6
virtualenv -p "/usr/local/Cellar/python/3.6.5_1/bin/python3.6" .env
Activate the virtualenv:
$ cd ~/your_project
$ source .env/bin/activate
Did it verk?
(.env) $ python --version
Python 3.6.5
Deactivate the virtualenv:
$ deactivate