# Development setup Windows ## Preliminaries First, install [`winget`](https://docs.microsoft.com/en-us/windows/package-manager/winget/) which is some sort of package manager/installer for Windows by Microsoft. Don't use the Windows store and use `winget` instead to get most of the software. Afterwards, install the [`Windows Terminal`](https://docs.microsoft.com/en-us/windows/terminal/) and then customize it at will, more on this later. > For those who like something simpler and cross platform I suggest you to try [alacritty](https://github.com/alacritty/alacritty). Unfortunately, `winget` doesn't have everything and a secondary package manager can be used for the rest. There are two options `chocolatey` and `scoop`. `scoop` is leaner. > A blogpost about `scoop` with some comparison to `chocolatey` that can be helpful can be read [here](https://justjensen.co/using-scoop-as-my-windows-package-manager/). ## Python Currently, you can get `Python` via the Microsoft Store. If you write `python` on the command prompt, you'll even get directed there. You can also find it via `winget` or `scoop`, both offering the latest version at the time of this writing (3.9.0). > When writing this guide, the `scoop` way was used successfuly. Our main tool is `conda`, and we'll cover that soon. Nevertheless, there is value in having an independent `Python` environment for the system as its'done in *nix world. > In *nix world there is the possibility of running something called [`pyenv`](https://github.com/pyenv/pyenv) which allows to have multiple versions for the interpreter. On Windows there is [`pyenv-win`](https://github.com/pyenv-win/pyenv-win). In our context, we will use `conda` for such purposes. To run Python based CLI applications a great option is to use [`pipx`](https://pipxproject.github.io/pipx/) to have independent virtual environments for them. It can be isntalled in the base Python installation as usual with `pip install pipx`. If you run into issues with paths, you'll get suggested a solution for that. Once `pipx` is installed you can follow getting some utilities like `black`, `flake8`, `bandit`, `mypy`, etc. You can choose to install `miniconda` via `winget`, `scoop`, or by downloading the installer manually. At last, use `winget` or `scoop` to install Git on your system, as you might most likely end up using it. In the recommended instalation of `miniconda` you won't be able to open Python from the console directly. The installation will provide shortcuts to Powershell and Cmd based prompts with `conda` and the system `python` available. Look into the shortcuts and using its content to create a new profile for `Windows Terminal`. For example ```json { "guid": "{ac8ffd71-0dc2-444c-95f3-7acb70358813}", "colorScheme": "One Half Dark", "name": "conda PowerShell", "commandline": "powershell.exe -ExecutionPolicy ByPass -NoExit -Command \"& 'C:\\Users\\iverg\\miniconda3\\shell\\condabin\\conda-hook.ps1' ; conda activate 'C:\\Users\\iverg\\miniconda3' \"", "icon": "C:/Users/iverg/Documents/Icons/anaconda.png", "startingDirectory": "~", "hidden": false, "tabColor": "#178A4F" }, ``` The important part is the `"commandline"` entry, where it should be what you find in the shortcut. `"tabColor"` is the color decorating the tab in Windows Terminal for this profile, which is a green close enough to the Anaconda one. > Be mindful of the `\\` part of the path as in JSON a single `\` has meaning and has to be escaped with an extra one. Once you reach this point, you have a fully operational and hopefully sane Python environment.