Guide spécifique pour installer multilang-python sur Windows.
- Python 3.7+ installé
- Git pour Windows
- PowerShell ou CMD
# 1. Cloner le repo
git clone https://github.com/fless-lab/multilang-python.git
cd multilang-python
# 2. Créer un environnement virtuel
python -m venv venv
# 3. Activer l'environnement virtuel
.\venv\Scripts\activate
# 4. Installer
pip install -e .
# 5. Vérifier
multilang-python --version# 1. Cloner
git clone https://github.com/fless-lab/multilang-python.git
cd multilang-python
# 2. Installer directement
pip install -e .
# 3. Vérifier
multilang-python --versionErreur:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d
Solution:
# Mettre à jour vers la dernière version du repo
git pull origin main
# Réinstaller
pip install -e .Cause: Encodage UTF-8 dans setup.py (déjà fixé dans la dernière version)
Solution 1: Utiliser Python directement
python -m multilang_python fichier.pySolution 2: Ajouter au PATH
# Trouver le chemin Scripts
pip show multilang-python
# Ajouter manuellement au PATH système
# Panneau de configuration > Système > Variables d'environnement
# Ajouter: C:\Python310\Scripts (ou le chemin de votre Python)Solution 3: Réinstaller avec --user
pip uninstall multilang-python
pip install --user -e .Erreur:
bash: command not found
Solution: Utiliser PowerShell au lieu de bash
# Au lieu de: bash demo/RUN_ALL_DEMOS.sh
# Exécuter manuellement:
multilang-python demo/01_hello.py
multilang-python demo/02_calculatrice.py
multilang-python demo/03_analyse_donnees.pyOu créer un script PowerShell:
# demo/RUN_ALL_DEMOS.ps1
Get-ChildItem demo/*.py | ForEach-Object {
Write-Host "Executing $_..." -ForegroundColor Green
multilang-python $_.FullName
Write-Host ""
}Symptôme:
�� au lieu de 🎉
Solution:
# Définir l'encodage UTF-8 pour le terminal
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
chcp 65001
# Ou ajouter à votre profil PowerShell
notepad $PROFILE
# Ajouter: [Console]::OutputEncoding = [System.Text.Encoding]::UTF8Solution: Exécuter en tant qu'administrateur
# Clic droit sur PowerShell > Exécuter en tant qu'administrateur
# Puis relancer l'installationOu installer en mode utilisateur:
pip install --user -e .# Démo 1: Hello World
python -m multilang_python demo/01_hello.py
# Démo 2: Calculatrice
python -m multilang_python demo/02_calculatrice.py
# Démo 3: Analyse de données
python -m multilang_python demo/03_analyse_donnees.py
# Démo 4: Espagnol
python -m multilang_python demo/04_multilangue_es.py
# Démo 5: Allemand
python -m multilang_python demo/04_multilangue_de.py
# Démo 6: POO
python -m multilang_python demo/05_classes_oop.pyCréer demo/RUN_ALL_DEMOS.ps1:
Write-Host "╔════════════════════════════════════════════════════════════╗" -ForegroundColor Cyan
Write-Host "║ DÉMONSTRATION MULTILANG-PYTHON ║" -ForegroundColor Cyan
Write-Host "╚════════════════════════════════════════════════════════════╝" -ForegroundColor Cyan
Write-Host ""
$demos = @(
"demo/01_hello.py",
"demo/02_calculatrice.py",
"demo/03_analyse_donnees.py",
"demo/04_multilangue_es.py",
"demo/04_multilangue_de.py",
"demo/05_classes_oop.py"
)
foreach ($demo in $demos) {
Write-Host "`n═══════════════════════════════════════════════════════════" -ForegroundColor Yellow
Write-Host "Exécution: $demo" -ForegroundColor Green
Write-Host "═══════════════════════════════════════════════════════════`n" -ForegroundColor Yellow
python -m multilang_python $demo
Write-Host "`nAppuyez sur une touche pour continuer..." -ForegroundColor Cyan
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
}
Write-Host "`n Démonstration terminée!" -ForegroundColor GreenPuis exécuter:
powershell -ExecutionPolicy Bypass -File demo/RUN_ALL_DEMOS.ps1Meilleur support UTF-8 et emojis:
# Via Microsoft Store
winget install Microsoft.WindowsTerminalAjouter à $PROFILE:
# Ouvrir le profil
notepad $PROFILE
# Ajouter ces lignes:
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
chcp 65001 | Out-Null
$env:PYTHONIOENCODING = "utf-8"Pour exécuter les scripts .sh:
# Via winget
winget install Git.Git
# Puis utiliser Git Bash
bash demo/RUN_ALL_DEMOS.sh# Créer un fichier de test
@"
# multilang-python: fr
fonction saluer(nom):
afficher(f"Bonjour, {nom}!")
saluer("Windows")
"@ | Out-File -Encoding UTF8 test_fr.py
# L'exécuter
multilang-python test_fr.py- Python 3.7+ installé (
python --version) - Git installé (
git --version) - Repo cloné
- Environnement virtuel créé et activé
- Package installé (
pip install -e .) - Commande fonctionne (
multilang-python --version) - UTF-8 configuré (emojis s'affichent correctement)
- Démos testées
Si les problèmes persistent:
-
Vérifier la version Python:
python --version # Doit être 3.7+
-
Réinstaller complètement:
# Supprimer l'environnement virtuel Remove-Item -Recurse -Force venv # Recréer python -m venv venv .\venv\Scripts\activate pip install --upgrade pip pip install -e .
-
Utiliser Python directement:
# Au lieu de multilang-python python -m multilang_python fichier.py
-
Vérifier les logs d'erreur:
pip install -e . --verbose
Une fois installé, consulte:
QUICKSTART.md- Guide rapideCHEATSHEET.md- Commandes de référencedocs/DEMO_GUIDE.md- Guide de présentation complet
Bon courage!