Python is a popular language for general-purpose
programming that has been widely adopted for scientific computing. Unfortunately, installing all of
its scientific packages individually can be difficult, so we will be relying on an
all-in-one installer called Anaconda.
For all instructions below, please ensure you install Python version 3
Install Python 3 using all of the defaults for installation. Make sure the
Register Anaconda as my default Python checkbox is selected before clicking 'Install'.
Install Python 3 using all of the defaults for installation.
(Installation requires using the shell. If you aren't
comfortable doing the installation yourself
stop here and request help at the workshop.)
Open a terminal window.
Type
bash Miniconda3-
and then press
tab. The name of the file you just downloaded should
appear.
Press enter. You will follow the text-only prompts. When
there is a colon at the bottom of the screen press the down
arrow to move down through the text. Type yes and
press enter to approve the license. Press enter to approve the
default location for the files. Type yes and
press enter to prepend Anaconda to your PATH
(this makes the Anaconda distribution the default Python).
The Bash Shell, Jupyter, and Git
Bash is a commonly-used shell that gives you the power to do simple
tasks more quickly.
Git is a version control system that lets you track who made changes
to what and has options for easily updating a shared or public
version of your code
on github.com.
We will teach Python using the Jupyter notebook, a programming environment
that runs in a web browser. For this to work you will need a reasonably
up-to-date browser. The current versions of the Chrome, Safari, and
Firefox browsers are all
supported
(some older browsers, including Internet Explorer version 9
and below, are not).
Windows
Open a command prompt
Open Start Menu
type cmd
press [Enter]
Type the following lines into the command prompt window one at a time exactly as shown, hitting [Enter]
after each one.
Continue to press [Enter] at any prompts and wait for the 'C:\' to return after
each command before progressing (the first step can take many minutes
and look like it's stuck, so please be patient).
You should now be able to find a new folder in your Start menu called 'Anaconda'. Inside the folder will
be two 'Anaconda Prompt' programs. Choose the one that doesn't say '(bash)'
Activate the correct conda environment by typing:
activate bash
Optionally, Cmder is a (much) nicer terminal environment for Windows.
Mac OS X
The default shell in all versions of Mac OS X is Bash.
Open the 'Terminal' program (found in /Applications/Utilities).
Type the following into the Terminal command prompt window exactly as shown:
conda install git jupyter pandas
Optionally, iTerm2 is a more feature-rich terminal environment that is
a little easier on the eyes.
Linux
The default shell is usually Bash, but if your machine is set up
differently you can run it by opening a terminal and typing bash.
Open the Terminal
Type the following into the command prompt window exactly as shown:
conda install git jupyter pandas
Data for the workshop
You will also need the gapminder dataset. Open a terminal window, copy the
following commands, and press enter:
cd ~/Desktop
git clone https://github.com/biologyguy/swc-data.git