This page was generated from instructions.ipynb.
Open in Colab

Open in Colab

Initializing course environment

There are multiple ways to set up a python environment for the course and to complete and submit exercises. The recommended alternatives are intended to make sure that all the necessary packages get installed and to minimize the probability that environment related issues arise while doing course work.

You are free to set up your course environment any way you like but support will only be provided for recommended setups.

1 Install Python and the needed external packages

(alternative a) Install full anaconda distribution

  • This is the recommended alternative

  • Will take about 3.3 gigabytes of disk space

  • Download the anaconda installer for your OS (64bits, Python 3) from https://www.anaconda.com/download

  • Install Anaconda

    • Linux: On command line run bash nameofthedownloadedfile

    • Windows/MacOS: Execute the installer you downloaded

  • Follow the instructions of the installer

  • Takes about 3 minutes

  • Verify that your installation is complete by downloading the script versions.py and run it with python versions.py.

    • Windows: use the Anaconda Prompt.

    • Linux/MacOS: use Terminal.

    • See Anaconda user guide for details, if needed

The lxml package included with the anaconda distribution may be older than the version specified in the versions.py -file. The older version will work for the purposes of this course, but may contain XSS vulnerabilities, and is not officially endorsed.

(alternative b) Install miniconda and Python packages

  • This alternative is not recommended

  • Will take about 2.3 gigabytes of disk space

  • Download miniconda installer (64bits, Python 3) from https://conda.io/miniconda.html

  • Run the installer

    • Linux: On the command line run bash nameofthedownloadedfile

    • Windows/MacOS: Execute the downloaded installler

  • Activate the miniconda environment

    • Linux and MacOS: source /miniconda/install/location/bin/activate

    • Windows: Start the anaconda command prompts

  • Download the requirements.txt file

  • Install the required packages with conda install --yes --file requirements.txt This may take awhile. (About 1 min 30 s on fast network)

2 Log in to the course

  • Go to the exercise page of the course

  • If you don’t already have an account on this server, press the signup button

  • Use your student number as the organizational id, if you want to get credits from this course. Note for old-timers: it is not enough, that you have your student number as your user name in TMC, in fact, that is not even recommended anymore.

  • Choose organization Helsingin yliopisto

  • Choose course Data Analysis with Python Summer 2021

3 Install TMC client

Suggested approach (With Anaconda Navigator installed)

Using Visual Studio Code (VS Code) and TestMyCode extension for VS Code.

  • To install VS Code, follow the instructions at https://www.mooc.fi/en/installation/vscode

  • Launch VS Code from the home tab on Anaconda Navigator

  • Follow the instructions for the part Installing Python Extension for VS Code at https://www.mooc.fi/en/installation/vscode

    • You can skip the part Installing Python (that was taken care of by installing Anaconda)

  • You will see a new TMC tab in the left section of VS Code.

  • To start programming and to download excercises, continue with the instructions at https://www.mooc.fi/en/installation/vscode (the part Starting programming) using

    • Organization: Helsingin yliopisto

    • Course: Data Analysis with Python Summer 2021

  • The instruction page also contains examples of how to test and submit your solutions to assignments from the introduction to programming course. You can follow these while substituting exercise names/numbers and code for the Data analysis with python exercises

Alternative approach (TMC CLI)

  • The TMC CLI requires a fairly modern java 8 or later to work properly.

    • open jdk 1.8.0_212 for example works

    • as do all 11.x and 12.x versions i’ve seen.

    • you can try to install and run tmc and update your java install if logging in with the cli fails.

  • Follow the instructions on the following page to install TMC client https://github.com/testmycode/tmc-cli

  • For this approach especially, you need to know the basics of command line use in the terminal/command prompt

  • Go to a folder where you want to download the exercises, and issue command tmc login

  • If it asks for a server address, then your TMC client is outdated. Re-install the client.

  • Provide login details, and use organization slug hy

  • Then issue command tmc download Course hy-data-analysis-with-python-summer-2021 to download the exercises

  • Important commands:

  • tmc to show help message

  • tmc test to test your solution locally

  • tmc submit to submit your solution to the server for grading

  • The above github page of the tmc-client also contains instructions on the use of the client

Open in Colab