# Installation of Python (WS24)
In this lecture we use Python 3.11 as our programming language. This guide follows the steps for installing python 3.11 for Windows, macOS and Debian Linux.
## Windows
Download the installer here:
* [Windows (64-bit)](https://www.python.org/ftp/python/3.11.5/python-3.11.5-amd64.exe)
* [Windows (32-bit)](https://www.python.org/ftp/python/3.11.5/python-3.11.5.exe)
1. Open the downloaded Python installer.
**Make sure to check the "Add Python 3.11 to PATH" mark!**

<!--  -->
2. Click on "Install Now". This may take a while.

<!--  -->
3. To finish the installation, click "Close".

### Verify Installation
To check if you successfully installed Python open up a new Terminal. Press the Windows key<kbd></kbd>, type `powershell` and hit enter.
A new terminal window opens up which should look something like this:

Next, enter ``python --version`` in the terminal and hit enter.

You should see the currently installed version of Python.
## macOS
You can install python using **either** the installer package <span style="color:red">**OR**</span> homebrew.
#### Using the installer package (.pkg)
Download the installer here
* [macOS 11](https://www.python.org/ftp/python/3.12.0/python-3.12.0-macos11.pkg)
1. Open the downloaded installer package, click on "Continue" and accept the licence

2. Click on "Install"

3. Finish the installation

#### Using homebrew
[Homebrew](https://brew.sh) is a free software package manager that can be installed by pasting the following line into the terminal (To open a terminal, press <kbd>⌘</kbd>+<kbd>Space</kbd>, type `Terminal` and hit enter)
>``/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"``
You might need to install Xcode command line tools first, by typing the following line into your terminal
>``xcode-select --install``
You can install python 3.12 by typing
>``brew update && brew install python@3.12``
<!-- **Optional**: You might want to add symbolik links like python->python3 and pip->pip3 to your Path by typing -->
<!-- > ``echo -n 'export PATH=/opt/homebrew/opt/python@3.10/libexec/bin:$PATH' >> ~/.zshrc`` -->
>
### Verify installation
Open a terminal (To open a terminal, press <kbd>⌘</kbd>+<kbd>Space</kbd> and type `Terminal`), type `python --version` and hit enter.

If an error is displayed like `command not found: python`, try `python3 --version` instead.
## Debian
If you are using a Linux-distribution based on Debian (like Ubuntu), type the following lines into a terminal (The keyboard sequence to open a terminal in Linux usually is <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>T</kbd>):
```bash
sudo apt update && sudo apt upgrade -y
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.11
```
# Installation of Jupyter Lab
In the lecture and tutorials we use Jupyter Lab. To install it, open a terminal and enter ``pip install jupyterlab``
Hint for macOS/Linux users: if this doesn't work, try ``pip3 install jupyterlab``.

To open Jupyter Lab, type ``jupyter lab`` in your terminal. A new browser window pops up with jupyter lab running in the localhost. Don't close your terminal while working in jupyter lab. ([Here](https://jupyterlab.readthedocs.io/en/latest/user/interface.html) is the documentation of the Jupyter Lab Interface and how to use it)
# IDE
To write your own Python code outside Jupyter Lab, you can use any text editor. However, we recommend to use an IDE (integrated development enviornment) which provides better syntax highlighting, text editing, debugging and many other helpful features.
Some common IDEs:
* [Visual Studio Code](https://code.visualstudio.com/) (recommended)
* [Pycharm](https://www.jetbrains.com/de-de/pycharm/)
* [Sublime Text](https://www.sublimetext.com/)
# Success?
Was your python installation successful? 🐍
If you encountered any problems, please let us know (via TC forum, e-mail) what didn't work.
<!-- If you encountered any problems, please participate in the [feedbackr](https://www.fbr.io/info) and tell us what didn't work. -->
<!-- # Discord
For the question sessions and code reviews we use [Discord](https://discord.com/download). There is an in-browser version, but we highly recommend installing the desktop version, as it supports more features and options. After Installing Discord and setting up your account you can join our server through the following Link: https://discord.gg/UGSDbsz
Make sure your microphone/speaker/screen sharing/webcam (webcam is only needed during code reviews) work with discord. [Here](https://support.discord.com/hc/de/articles/360045138571-Beginner-s-Guide-to-Discord) is a tutorial.
When you first join the discord server you see the "groupselection" textchannel. Click on the green mark to select that you attend the course "Informatics 2".

After that you have been granted the correct student role and you should see the following channels on the left side of discord:

Those channels which are marked with a "#" symbol are text channels only (see 1, 2) and those channels with the "🔊" symbol are voice channels only (see 3, 4).
1. The "infos" text channel is used by the tutors to communicate with students. (This is a read-only channel)
2. The "chat" text channel can be used by students to ask questions during question hour.
3. The "Lobby" voice channel is used by students to wait for their personal talk with a tutor, for example code reviews, very specific questions that can't be answerd in the TC Forum/question hour, ... (students have to enter this channel so tutors can see and move them to their private room)
4. The "TUTORIEN" voice channels are used by the tutors for question hours (you can join them during question hour) -->