# Windows 10 version 2004 and up or 11 - release and development
A guide on how to set up a workspace and run ERPLibre on Windows 10 version 2004 and up or Windows 11. There are two methods of installation, one is automatic and the other manual.
**"WSL2 Ubuntu 22.04" will be referred as "WSL2"**
**"PyCharm Professional" will be referred as "PyCharm"**
## Install WSL2
Run Powershell with administrator rights and run the following command:
Un guide pour configurer un espace de travail et exécuter ERPLibre sur Windows 10 version 2004 et plus ou Windows 11. Il existe deux méthodes d'installation, une automatique et l'autre manuelle.
If you have trouble opening the Powershell with administrator rights, press `Windows + R`, enter the following line and press `OK`. You will be automatically prompted for administrator rights.
Si vous avez des difficultés à ouvrir Powershell avec les droits administrateur, appuyez sur `Windows + R`, entrez la ligne suivante et appuyez sur `OK`. Les droits administrateur vous seront automatiquement demandés.
If you have issues enable virtualization options in BIOS is available (hyper-v, vt-x, etc). Search for `Turn Windows features on or off` in the Windows search bar and ensure that `Windows Subsystem for Linux` is turned on before restarting your machine.
Si vous rencontrez des problèmes, activez les options de virtualisation dans le BIOS si disponibles (hyper-v, vt-x, etc). Recherchez `Activer ou désactiver des fonctionnalités Windows` dans la barre de recherche Windows et assurez-vous que `Sous-système Windows pour Linux` est activé avant de redémarrer votre machine.
Download and install the lastest Linux kernel update package from Microsoft with the following [link](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi):
Téléchargez et installez le dernier package de mise à jour du noyau Linux de Microsoft avec le [lien](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi) suivant :
À chaque redémarrage de votre machine, la commande suivante doit être exécutée pour démarrer le service PostgreSQL s'il n'est pas déjà en cours d'exécution :
While ERPLibre is running, make sure that you can connect to the following URL `http://localhost:8069` and have the ability to create, modify and remove databases.
## Set up Development Environment - PyCharm
### Install PyCharm
Install PyCharm from the following [link](https://www.jetbrains.com/pycharm/download/#section=windows):
Pendant qu'ERPLibre est en cours d'exécution, assurez-vous que vous pouvez vous connecter à l'URL suivante `http://localhost:8069` et que vous avez la possibilité de créer, modifier et supprimer des bases de données.
Select `Connect to WSL` under `Remote Development`. After that select your Ubuntu instace ("Ubuntu-22.04"). Point `Project directory` to the root of the project. Once everything has been selected and filled out correctly, click on `Start IDE and Connect`.
Sélectionnez `Connect to WSL` sous `Remote Development`. Ensuite sélectionnez votre instance Ubuntu ("Ubuntu-22.04"). Pointez `Project directory` vers la racine du projet. Une fois que tout a été sélectionné et rempli correctement, cliquez sur `Start IDE and Connect`.

<!-- [en] -->
Press `CTRL+ALT+S`, search for `interpreter` and inside the `Python Interpreter` page, click on `Add Interpreter` and select `Add Local Interpreter...`.
Appuyez sur `CTRL+ALT+S`, recherchez `interpreter` et dans la page `Python Interpreter`, cliquez sur `Add Interpreter` et sélectionnez `Add Local Interpreter...`.
Make sure to select `Virtualenv Environment` on the left and the `Existing` radio button. Once theses are both selected properly, point your interpreter to the `../ERPLibre/.venv/bin/python` directory of the project and click on `OK`.
Assurez-vous de sélectionner `Virtualenv Environment` à gauche et le bouton radio `Existing`. Une fois les deux correctement sélectionnés, pointez votre interpréteur vers le répertoire `../ERPLibre/.venv/bin/python` du projet et cliquez sur `OK`.
Si ces dernières étapes pour configurer votre environnement de développement n'ont pas fonctionné, suivez les étapes "Manuelles" suivantes pour configurer votre environnement.
Vous pouvez supprimer les fichiers restants dans votre répertoire personnel concernant l'installation de Python une fois les étapes complétées avec succès.
Wait until PyCharm detects your WSL2 instance and press `NEXT`. Click on `System Interpreter` on the left, select the correct interpreter if it hasn't done so automatically and click `Create`.
Attendez que PyCharm détecte votre instance WSL2 et appuyez sur `NEXT`. Cliquez sur `System Interpreter` à gauche, sélectionnez le bon interpréteur s'il ne l'a pas fait automatiquement et cliquez sur `Create`.
If you experience high memory usage, click on `Help` in the toolbar and choose `Change Memory Settings` to increase the memory heap of the IDE.
### Missing or incorrect imported modules
PyCharm might not fully recognize some details from `requirements.txt` and `pyproject.toml` (e.g., specific module versions). If you encounter issues at runtime or while debugging, search for the correct version of the module and reinstall it using PyCharm's package manager.
### Can't run ERPLibre from PyCharm
If ERPLibre fails to run from PyCharm, execute the following command in the root directory of the project from the terminal in PyCharm or WSL2:
### Avertissements d'utilisation élevée de la mémoire
Si vous constatez une utilisation élevée de la mémoire, cliquez sur `Help` dans la barre d'outils et choisissez `Change Memory Settings` pour augmenter la mémoire allouée à l'IDE.
PyCharm peut ne pas reconnaître complètement certains détails de `requirements.txt` et `pyproject.toml` (par exemple, des versions spécifiques de modules). Si vous rencontrez des problèmes à l'exécution ou lors du débogage, recherchez la bonne version du module et réinstallez-le avec le gestionnaire de paquets de PyCharm.
Documentation officielle de PostgreSQL pour le dépannage des problèmes courants et pour en apprendre davantage sur les commandes et la configuration de PostgreSQL.