Pip and virtualenv on a Mac

Written by Art, June 18, 2017

Install pip

Pip (Python Package Installer), official documentation for pip.

Usually Python3 comes with pip preinstalled. If you get an error "pip command not found", use the following command to install pip:

sudo easy_install pip

Install virtualenv

virtualenv is a tool to create isolated Python projects. Think of it, as a cleanroom, isolated from other virsions of Python and libriries.

Enter this command into terminal

sudo pip install virtualenv

or if you get an error

sudo -H pip install virtualenv

Start virtualenv

Navigate to where you want to store your code. Create new directory.

mkdir my_project && cd my_project

INSIDE my_project folder create a new virtualenv

virtualenv env

Activate virtualenv

source env/bin/activate

Share with:

About author


Art is a FinTech enthusiast who has a great passion for coding and teaching. He earned a M.Sc. from Adelphi University, Garden City, New York. Currently, he develops software for the financial services industry and leads classes and workshops in Python at PracticalProgramming.co

Python Immersive

Become a proficient Python programmer, master programming skills by working on real life projects

Learn more

Machine Learning Immersive

Today’s modern machine learning libraries have thoughtful APIs that allow anyone who is comfortable with code to dive into ML

Learn more

Javascript fundamentals

We speak to beginner coders on HOW TO GET STARTED as a developer as well as practice typing Javascript live coding

Learn more

Python 101

This class aims to help beginners to feel justifiably confident to start using Python programming language

Learn more

Intro to JavaScript

Learn how to use modern front-end frameworks with JSON and AJAX

Learn more