Skip to content

Latest commit

 

History

History
175 lines (109 loc) · 6.36 KB

tech_setup.md

File metadata and controls

175 lines (109 loc) · 6.36 KB

Software, tools, etc.

This course requires a number of free services and tools available on Unix/Mac systems. If you're on Windows, see below for options.

See the Technical FAQ page if you run into snags and/or report an issue.

Services and Platforms

Windows

Windows users will need to gain access to a Linux system.

Data Journalism VM

We offer a Linux virtual machine with a graphical Desktop environment, pre-configured with most of the software you'll need for the course. To use it:

Congrats! You're almost done. Skip to the DataKit install.

VSCode and Windows Subsystem for Linux

For users on more modern versions of Windows, you can use the Windows Subsystem for Linux. This provides a ready-made Linux shell environment (without a graphical Desktop) that integrates nicely with the Visual Studio Code Editor.

Follow the instructions here to get up and running.

With this option, you will need to perform the additional Linux setup steps described below.

Text Editor

You'll need a text editor designed for working with code. For beginners, we recommend VSCode or Atom, although you're free to use other tools of your own choosing.

Shell Terminal

Mac and Linux both come with terminal programs, which provide a text-based interface to your operating system and related command-line tools.

On Mac, use Command + spacebar to perform a Spotlight search for "Terminal".

For a more pleasant shell experience, we strongly recommend installing iTerm2.

Version control

Git is a version control system we use to save and submit code and data for class assignments and projects.

Mac

Install Homebrew, a software package manager used on the command line. Then use Homebrew to install git.

Open a Terminal shell (see above) and run the below commands. Along the way, you'll be prompted to agree to Apple licensing terms and to provide your laptop password.

xcode-select --install

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew doctor
brew update
brew install git

The commands above are based on Steps 1-3 of How to Install Xcode, Homebrew, Git etc. See the blog post for more details.

Linux

Open a terminal shell and run:

sudo apt install git-all

Python

Python 3.5 - 3.8

Before installing Python, first open a shell and run: python --version.

If you have a version between Python 3.5 and 3.8, you're all set.

If you have an older Python version (e.g. 2.7), follow the below instructions.

Mac

Follow these steps but skip the installation of Homebrew, which should have been installed earlier when we set up git (see above).

Linux

Use pyenv, a tool that allows you to install and manage multiple versions of Python. Run these commands from a shell:

# Clone pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv

# Add pyenv vars to bash config
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bashrc

# Reinitialize shell
exec "$SHELL"

# Install build dependencies
sudo apt-get update
sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

# Install python version 3.7.6
pyenv install 3.7.6
pyenv global 3.7.6

Configure

Open a Terminal/shell.

Download and run our configuration script. You'll need to answer a few questions along the way.

cd ~

curl -O https://raw.githubusercontent.com/stanfordjournalism/stanford-dj-vm/master/configure_system.py

python configure_system.py

The configuration script will prompt you to peform a few additional steps:

  1. Upload your ssh public key to GitHub
  2. Create a GitHub API token
  3. Open ~/.datakit/plugins/datakit-github/config.json and replace GITHUB_API_TOKEN with the actual token from GitHub.

DataKit

Before this step, make sure you've completed all configuration described above.

DataKit is a command-line tool we'll use to manage code and data for class assignments. It provides a standardized structure for projects and allows us to easily submit code to GitHub.

Run the following command to install DataKit:

curl -s https://raw.githubusercontent.com/stanfordjournalism/cookiecutter-stanford-progj/master/requirements.txt | xargs pip install

Follow these instructions to complete the DataKit setup.