Part 0: Setup

IMPORTANT: Please be sure to work through the machine setup before proceeding.

Need to cheat a bit? The complete Data Viz scripts can be found in new-coder/dataviz.

Change into the Data Viz project:

1

$ cd new-coder/dataviz

Make sure you’ve installed virtualenvwrapper and followed the steps from the machine setup to set up your terminal correctly.
.
To make a virtual environment specific to your Data Viz project, run the following command. You should see (DataVizProj) before your prompt.

1
2

$ mkvirtualenv DataVizProj
(DataVizProj)$

Now we will install the package requirements for this project. Your virtual environment will store the required packages in a self-contained area to not mess up with other Python projects.

Finicky matplotlib doesn’t install?

Sometimes, matplotlib is finicky as well. If you are on a Mac or Linux, and pip install matplotlib did not work, you are probably missing the supporting packages zlib, freetype2 and libpng. Windows users do not need to worry about this as these packages are already included in the standard matplotlib Windows installers.

FREETYPE

$ cd ~/Downloads # or whichever directory the downloaded file was saved into$ cd freetype-x.y.z # whatever the version is you downloaded$ ./configure
$ make
$ sudo make install

After installing these three packages, try typing pip install matplotlib in your activated virtualenv, (DataVizProj) and it should work.

Test the installation real quick by starting up the Python interpreter:

1
2
3
4

(DataVizProj)$python>>>importnumpy>>>importmatplotlib>>>importgeojson

If you have no errors (you would just see the >>> prompt), then you’re good to go. You can close out of the Python interpreter by pressing CTRL+D. If you do have errors, I’d try downloading numpy and matplotlib manually.