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

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 101

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

Learn more

Python Immersive

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

Learn more

Next Level Python

Get ready to move up with Next Level Python! This course is designed to help you get to the next level, to push through the beginner level up to intermediate.

Learn more

Web Scraping

We go through the whole process of gathering, storing and analyzing data from the Web

Learn more

Introduction to SQL

Structured Query Language for Data Science, learn the core concepts of databases

Learn more