Diving Into the Deluge of Data :: Personal Environments

Setting Up Your Own Environment

The goal of this guide is to get you set up with the course development environment on your own personal OS X machine. We are focusing on OS X because (1) it is popular and (2) it is the same operating system that we have in the lab. If you have a Linux environment, the steps will be similar but different enough that this guide will not work. Please let us know if you would like to use a non-OSX system and we can try to figure out the best way to accommodate. The complete toolchain is already available on all on-campus Macs. This includes Jesup, science labs, and the libraries.

Summary of Steps

  • Install homebrew
  • Install python3 using homebrew
  • Install virtualenv using pip3
  • Install git using homebrew
  • Install/choose your text editor

Step 1: Install the Homebrew Package Manager

Homebrew is a package manager. For developers, a package manager lets them assemble their software, along with all of the outside utilities it depends upon, into a package and distribute that package to many users. When the developers make updates, they push the updates to one central location, where all users receive them quickly.

For users like us, a package manager lets us get the latest software, easily, and keep it up-to-date.

To install homebrew, go to brew.sh and follow the instructions.

Essentially, you must open up your terminal (in Applications->Utilities) and type/copy-paste the command they provide. What this command does is download a script from the Internet and run it on your local machine. The script should walk you through the install process, asking your permission before making any changes. It is always dangerous to run anything you see on the Internet, but this is relatively safe since we have some faith in the brew community.

The command looks something like this:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
(Installing homebrew requires you to have administrator privileges and to have installed Xcode.)

Step 2: Install python3

Next, install python3 using homebrew. By default, OSX comes packaged with Python 2.7. Many important system applications depend on this version of Python, so we will be installing Python 3 in addition to not instead of Python 2.7. Multiple Python versions can happily coexist on our systems.

$ brew install python3

This will install python3 in brew's management directory. It will also add a link to python3 at /usr/local/bin/python3, which is in your system's default search path. What this means is that when you type 'python3' at the command line, your system knows where to find it—the search path tells your system where to look.

Step 3: Install virtualenv

Virtualenv is no longer needed. Use 'pyvenv' instead!

Step 4: Install git

Although we now have everything we need to write and run programs, we still need a way to manage our projects. For that, we will download and install the git version control system.

$ brew install git

Just like with python3, brew will install git into its management directory, and place a link at /usr/local/bin/git, where our system knows where to find it. You can test your installation by typing:

      $ which git
      /usr/local/bin/git
    

The which program walks your search-path, in order, and tells you which version of a program your system will use. If you do not see any output, it means that which, and therefore your system, cannot find the program you requested.

Step 5: Text Editors

There are many good text editors. People swear by emacs and vim. In a pinch, you can also use nano. Currently, many people like sublime. In class we will use Atom, but you should feel empowered to use whichever text editor makes you happy.

Both emacs and vim should be installed by default. You can open these from the command line:

$ emacs
or
$ vim

These two editors have rich histories and vast amounts of online documentation available to help you to customize and maximize your experience. They are, however, decades old and come with a steep learning curve. There is a long-running debate over which editor is better, but the best editor is the one that lets you be productive.

To install atom, you can use an add-on for brew, called cask, which lets you install OS X applications from the command line. To get cask:

$ brew install caskroom/cask/brew-cask
and then you can install atom using:
$ brew cask install atom
That's it!