Installing CSVkit

tl;dr

Open a terminal (doesn’t matter what directory you’re in) and run the following command:

sudo easy_install csvkit

By “run the command” I mean type all that at the prompt and hit return. OSX will ask for your password. Enter it.

If you get an error, skip to step 3, below.

Longer version:

CSVkit is a suite of utilities written in
Python. It is available as a Python module, which means we can use one of Python’s module installers to install it on your computer. OSX ships with easy_install by default, but like a lot of people, I prefer pip.

As it turns out, OSX ships with easy_install. This isn’t a python class or a programming class, it’s a data class and all I really want is to walk you all through how you might dig in to a monster CSV file with some command line tools. For that, it really doesn’t matter how you install CSVkit as long as you install it.

So here are some good options:

  1. Install Homebrew. Then do pip install csvkit at the command line. If you get an error that suggests you don’t have permission to install it, try sudo pip install csvkit to install with root privileges. Try man sudo if you want to understand what the command does. If you want to explore more programming, this is probably your best option.

  2. Alternatively, you can install pip with easy_install (using sudo easy_install pip) and then install CSVkit with sudo pip install csvkit. Choosing this option won’t mean you can’t install Homebrew later.

  3. If you don’t have admin privileges on your computer, you’re going to have to do some fancy footwork no matter what. Head over to my notes on installing CSVkit for a rundown of instructions.

If you run into trouble, let me know what the trouble is.