Initial setup for our Data Visualization Tutorial.
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:
$ 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.
$ mkvirtualenv 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.
(DataVizProj)$ pip install -r requirements.txt
NOTE: Sometimes, NumPy is finicky. If the previous step returns errors, try the following:
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.
To install (order of installation is important here):
Go to zlib’s site and download the latest source code archive.
Scroll down to zlib source code, and download the latest current release in tar.gz format
Unpack the downloaded file by double-clicking to open it up.
Open your terminal, and type as follows:
$ cd ~/Downloads # or whichever directory the downloaded file was saved into$ cd zlib-x.y.z # whatever the version is you downloaded$ ./configure
$ sudo make install
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.