Skip to content

Getting Started

paragrastogi edited this page Mar 5, 2018 · 2 revisions

Getting started

I will assume you have a Windows computer and an internet connection. You can use most of these commands in a Linux command line as well - just make sure you get Linux distros from the web instead of Windows ones! I have developed these scripts using Python 3.6.3 and Jupyter 4.3.0.

1. Installing Python

Do you already have Python 3 (any version, but preferably 3.6) installed? Great, you're winning already. Skip ahead to the next section.

If not, go to the conda website and install the 64-bit version for Python 3.6. Anaconda is just one distribution of Python (and R) - feel free to install the latest basic python from the project's own website.

NB: I will use the command conda install to install packages below. If you would like to use the basic python distro, then you must use pip install.

Open the command prompt by pressing Windows+R and typing cmd in the little window that appears. The command prompt is that dank black screen with a blinking cursor that all the strange computer people seem to have on their screens, shown here in all its glory. Your parents or professors might call it the "MS-DOS prompt". Ignore them, they are wrong.

In the command prompt, type:

python --version

You should see something like this:

Python 3.6.3 :: Anaconda, Inc.

If you don't see this or you see an error, it could mean one of two things: you haven't installed Python or the command python is not in your PATH variable. See this helpful link to resolve the latter issue.

Set up with Python? Good! Proceed to step 2.

2. Installing Python modules

AKA Command Line Superpowers

We will use the command prompt to install the modules/packages/libraries needed for this tutorial. Use the following commands, in no particular order:

  • conda install jupyter
  • conda install numpy
  • conda install scipy
  • conda install pandas

If all of these modules installed fine, you are all set to start with the notebooks for this workshop. You can check your installation by using the conda install <module name> command again. If the module is already installed, you will get a message saying All requested packages already installed..

Now, how do you actually download all these scripts and notebooks to your computer?

3. Downloading this repository

In your browser, go to the github repo. On that page, you should see a green button labelled Clone or download. Click on that to see options. The easiest is to download the repository as a ZIP file. You can also copy the git link (same as the web address but ending in .git) and use git on your computer to clone or fork the repo. See this webpage for instructions on how to download and use git. Don't be afraid to use the command line interface for big girls/boys.

4. Running the IPython notebook

In the command prompt, navigate to the folder where you have cloned/downloaded this repository. Navigate to the scripts directory. Run a dir command to see if the IPython notebook exists in the scripts directory. If it does exist, and it should, type the following command:

jupyter notebook tutorial.ipynb

You will see a bunch of time-stamped commands start flowing in the command prompt. Your default browser (I use Firefox) will fire up and the notebook will open in a new tab. Do not close the command prompt where you started the notebook while you are working on it. This will shut down the python server for your notebook and it will no longer work.