Scientific Computing Workshop: Setting up Python

By | March 9, 2019

Note the content listed here is the same used by the Software Carpentry community.

Since it had already been well covered there, I am only reproducing it here. Please note that the instructions listed here worked up till June, 2018. Problems setting up Python may arise over time. The ones that I become aware of and can find a solution for will be added to this post.

This article is aimed for people who are going to be attending a Scientific Computing workshop, organised by IDRACK, which includes either modules on “Programming with Python” or uses python-based scripts to demonstrate some scientific concepts.

The Python environment has extensive add-on so instead of manually installing everything, Anaconda, an all-in-one installer, is recommended. You are welcome to install either python 2.x or 3.x, unless asked to install something specific (in case of 2.x, please use 2.7 and in case of 3.x please use 3.6). Legacy versions may or may not work depending on the exact task python is used for on workshop day.

I will make use of the Jupyter notebook, which needs a relatively modern web browser. Current versions of the Chrome, Safari and Firefox browsers are all supported.

Here are the instructions for the three most commonly used OSs.

Windows:

  1. Open https://www.anaconda.com/download/#windows with your web browser.
  2. Download the Python installer for Windows.
  3. Install Python using all of the defaults for installation except make sure to check Make Anaconda the default Python.

macOS

Open https://www.anaconda.com/download/#macoswith your web browser.

  1. Download the Python installer for OS X.
  2. Install Python using all of the defaults for installation.

Linux

  1. Open https://www.anaconda.com/download/#linux with your web browser.
  2. Download the Python installer for Linux.
    (The installation requires using the shell. If you aren’t comfortable doing the installation yourself stop here and request help at the workshop. This may not always be available especially if I am already running late, which is mostly the case, in which you will have to share a computer with your friend.)
  3. Open a terminal window.
  4. Type
    bash Anaconda3-

    and then press tab. The name of the file you just downloaded should appear. If it does not, navigate to the folder where you downloaded the file, for example with:

    cd Downloads

    Then, try again.

  5. Press enter. You will follow the text-only prompts. To move through the text, press the space key. 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).
  6. Close the terminal window.

Use this page which has instructions from a Software Carpentry workshop, to test if everything is functional.

If you have problems, please email me at

contact.idrack@gmail.com

or

send me a message on IDRACK’s Facebook page here: https://www.facebook.com/idrack.pk

NOTE: Please don’t leave this process to be done on the Workshop day. That wastes a lot of times.

2 thoughts on “Scientific Computing Workshop: Setting up Python

  1. Pingback: Installing Biopython and other things pythonic - IDRACK: Blog

  2. Pingback: The Protein Structure Series: Post – IV - IDRACK: Blog

Leave a Reply

Your email address will not be published. Required fields are marked *