# Initializing course environment¶

## 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
• Install anaconda
• Linux: On command line run bash nameofthedownloadedfile
• Follow the instructions of the installer
• windows: In the anaconda navigator, start the conda prompt.
• Verify that your installation is complete by downloading the script versions.py and run it with python3 versions.py.

### (alternative b) Install miniconda and Python packages¶

• This alternative is not recommended
• Will take about 2.3 gigabytes of disk space
• Run the installer
• Linux: On the command line run bash nameofthedownloadedfile
• Activate the miniconda environment
• Linux and MacOS: source /miniconda/install/location/bin/activate
• Windows: Start the anaconda command prompts
• Install the required packages with conda install --yes --file requirements.txt This may take awhile. (About 1 min 30 s on fast network)

• 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 2019

## 3 Install TMC client¶

• TMC 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
• Note that on this course we use the command line version of TMC, not netbeans or any other IDE. So, 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. Note, that the installation script was updated very recently (12.3.2019). So, if you had problems with it, you might want to try again.
• Provide login details, and use organization slug hy
• Then issue command tmc download hy-data-analysis-with-python-summer-2019 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

### Note for windows users¶

As there is no installer, you get the tmc cli client by downloading the latest .jar file from releases. To actually run the tmc cli you issue the exact commands below but substituting tmc with java -jar <path-to-jar-file>.jar as specified here.

You may want to alias the java -jar <path-to-jar-file>.jar -part of the command so that just the command tmc works on windows as well. This can be done according to these instructions.

• Create a aliases.cmd file
• Add the following to the file: @echo off   doskey tmc=java -jar <Path-to-tmc-jar> \$*
• In regedit <https://support.microsoft.com/en-us/help/4027573/windows-10-open-registry-editor>__, browse to HKEY_CURRENT_USER\Software\Microsoft\Command Processor
• Create a new registry key-value pair of type REG_EXPAND_SZ, with name AutoRun and the path to the aliases file as value
• Now the tmc alias should always be added when a new console is opened

Thanks to @Eeero for the step-by-step instructions.