Virtual Environments I: Installing Pyenv with Homebrew

a lego toy office worker frustrated in front of a tiny computer
Image by www_slon_pics from Pixabay

I. Installing Pyenv with Homebrew

  1. First, open the terminal and and make sure you are using Bash. You will know you are using bash if you see this on the first line:
bash-3.2$
username@user-computer$ 
bash
$ brew update
$ brew install pyenv

II. Using Bash and Nano to Create a .bash_profile

$ ls -a
$ nano
screen shot of a nano file
screen shot of a nano file
echo ‘export PYENV_ROOT=”$HOME/.pyenv”’ >> ~/.bash_profile
echo ‘export PATH=”$PYENV_ROOT/bin:$PATH”’ >> ~/.bash_profile
eval “$(pyenv init -)”
 exec $SHELL

III. Using Pip to Install Virtualenv

$ pip3 install virtualenv
$ pip3 install virtualenvwrapper
$ brew install pyenv-virtualenv
eval “$(pyenv virtualenv-init -)”

IV. What Did We Do?

V. What’s Next?

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store