# Part 1: Installing Thonny IDE
###### tags: `TA Stuff RP2` `Raspberry Pi Pico`
Although VS Code is the preferred IDE of software developers, Thonny is a ***beginner-friendly alternative*** which you can use to complete this course. In this tutorial, we walk you through the basic installation of the Thonny development environment.
:::info
If you prefer VS Code for development, follow [**this tutorial**](https://hackmd.io/@lnu-iot/rkiTJj8O9).
:::
We'll continuously update this walkthrough. **Is there anything that needs to be clarified, or have you experienced some issues? Please add a comment.** You do this by highlighting the text and then you can write a comment on the highlighted part. You need to log in/create an account on HackMD first.
## 0. Prerequisites
To finish this tutorial you need:
* Your computer (Windows, Linux, or Mac)
* Internet connection
:::info
**Depending on your operating system follow one of the following sections.**
:::
### [Windows](#Windows-OS)
### [Mac](#Mac-OS)
### [Linux](#Linux-OS-(Ubuntu-/-Fedora))
## Windows OS
Follow these steps:
+ **Step 1:** Download and install [**Thonny (here)**](https://github.com/thonny/thonny/releases/download/v4.1.7/thonny-4.1.7.exe).
:::info
You should follow the next tutorial [**(here)**](https://hackmd.io/@lnu-iot/rkFw7gao_) to update your device firmware before continue with the next step.
:::
+ **Step 2:** Open Thonny (first time you open Thonny you should see somthing similar to the following figure).

+ **Step 3:** Click on `View >> Files` to open the file manager panel.

+ **Step 4:** Open interpreter selection from `Run >> Configure interpreter...`

+ **Step 5:** Choose your Raspberry Pi Pico similar to the numbered steps in the following figure.

+ **Step 6:** You should see you board REPL (Read-Eval-Print Loop). You can enter `print('LNU Tutorial')` and you see your board prints it to the serial port like the following image.

:::success
You are now ready to move to the next tutorial [**(here)**](https://hackmd.io/@lnu-iot/B1T1_KM83) to get familiar with terms and project structure.
:::
## Mac OS
Follow these steps:
+ **Step 1:** Download and install [**Thonny (here)**](https://github.com/thonny/thonny/releases/download/v4.1.7/thonny-4.1.7.pkg).
:::info
You should follow the next tutorial [**(here)**](https://hackmd.io/@lnu-iot/rkFw7gao_) to update your device firmware before continuing with the next step.
:::
+ **Step 2:** Open Thonny (first time you open Thonny you should see somthing similar to the following figure).

+ **Step 3:** Click on `View >> Files` to open the file manager panel.

+ **Step 4:** Open interpreter selection from `Run >> Configure interpreter...`

+ **Step 5:** Choose your Raspberry Pi Pico similar to the numbered steps in the following figure.

+ **Step 6:** You should see you board REPL (Read-Eval-Print Loop). You can enter `print('LNU Tutorial')` and you see your board prints it to the serial port like the following image.

:::success
You are now ready to move to the next tutorial [**(here)**](https://hackmd.io/@lnu-iot/B1T1_KM83) to get familiar with terms and project structure.
:::
## Linux OS (Ubuntu / Fedora)
Follow these steps:
* **Step 1:** Download and run the [Thonny](https://thonny.org/) installation script:
```shell=
bash <(curl -s https://thonny.org/installer-for-linux)
```
This command downloads the installations script for your platform and then runs it.
* **Step 2:** Open Thonny
:::info
You should follow the next tutorial [**(here)**](https://hackmd.io/@lnu-iot/rkFw7gao_) to update your device firmware before continuing with the next step.
:::
:::warning
Before opening Thonny, you must change the access permissions for the Pico. You can do this by connecting the Pico to the computer and open up a `Terminal` and execute this command: `sudo chown <USERNAME> /dev/ttyACM0`, where `<USERNAME>` should be your own user name. **This must be done every time you connect the Pico to the computer.**
:::
Give access permissions to the Pico with the following command:
```shell
sudo chown <USERNAME> /dev/ttyACM0
```

Open Thonny:

* **Step 3:** Click on `View >> Files` to open the file manager panel.

* **Step 4:** Go to `Run >>> Configure interpreter` to select your Pico.

* **Step 5:** Select your Pico by following the numbered steps:
:::info
The Pico port is usually `/dev/ttyACM0` on Linux, but it can vary.
:::

* **Step 6:** Now you should see the **REPL** (Read-Eval-Print Loop) in Thonny. Try to print something to make sure it works.

:::success
You are now ready to move to the next tutorial [**(here)**](https://hackmd.io/@lnu-iot/B1T1_KM83) to get familiar with terms and project structure.
:::
### Other
:::info
This tutorial is based on [**another tutorial**](https://randomnerdtutorials.com/getting-started-thonny-micropython-python-ide-esp32-esp8266).
:::