Bonjour,

Je tente de créer un exécutable de GlobalApplis.py avec PyInstaller...
Lors de mon premier essai PyInstaller a créé un fichier GlobalApplis.spec, mais les dossiers(build et dist) restaient vides de données...
Afin qu'il puisse s'occuper des fichiers textes que les modules__init__.py traitaient, GlobalApplis.spec a donc été renseigné. Ainsi, les dossiers(build et dist) étaient renseignés...

Mais, le fichier GlobalApplis.exe dans le dist avait zéro octet (vide)...
À ce moment, il n' y a pas les dossier(tcl et tk) dans le dossier dist...

Puis en réfléchissant, comme il y a plusieurs modules.py et que import tkinter est dans l'un d'entre eux tout en étant absent de GlobalApplis.py par lequel est lancé le programme.
Il fallait écrire import tkinter au début du programme principal GlobalApplis.py...
Après agir pyinstaller GlobalApplis.spec, et le fichier GlobalApplis.exe dans le dist avait 1.61 mega octets (♪☺♪)...

À ce moment, il n' y a pas les dossier(tcl et tk) dans le dossier dist, ni les dll qui vont avec...
Sauf, qu'hélas ne fonctionne toujours pas

Lien github : https://github.com/Toumic/GlobalApplis

Fichier : GlobalApplis.spec
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
 
# -*- mode: python ; coding: utf-8 -*-
 
 
 
 
block_cipher = None
 
 
addedFiles = [
('GlobEnModes/__init__.py', 'GlobEnModes'),
('GlobGamChrom/__init__.py', 'GlobGamChrom'),
('GlobGamFonds/__init__.py', 'GlobGamFonds'),
('GlobGamMicro/__init__.py', 'GlobGamMicro'),
('GlobGamSim/__init__.py', 'GlobGamSim'),
('GlobGamVers6/__init__.py', 'GlobGamVers6'),
('GlobInverseAcc/__init__.py', 'GlobInverseAcc'),
('GlobModelGammy/__init__.py', 'GlobModelGammy'),
('GlobTetraCord/__init__.py', 'GlobTetraCord'),
('GlobalTexte/CommentGlobGamChrom.txt', 'GlobalTexte'),
('GlobalTexte/CommentGlobGamChromII.txt', 'GlobalTexte'),
('GlobalTexte/couleursethexa.txt', 'GlobalTexte'),
('GlobalTexte/glob_datagams.txt', 'GlobalTexte'),
('GlobalTexte/globdic_Dana.txt', 'GlobalTexte'),
('GlobalTexte/globdicTcode.txt', 'GlobalTexte'),
('GlobalTexte/globdicTcord.txt', 'GlobalTexte'),
('GlobalTexte/globdicTcoup.txt', 'GlobalTexte'),
('GlobalTexte/globdicTgams.txt', 'GlobalTexte'),
('GlobalTexte/RunGlobalApplisPy22012022PLUS.txt', 'GlobalTexte'),
('GlobalTexte/RésultatRunGlobalApplisPy_1.txt', 'GlobalTexte'),
('GlobalDoc/calcul_tare_gam.py', 'GlobalDoc'),
('GlobalDoc/Contemplation_alteration_1', 'GlobalDoc'),
('GlobalDoc/Contemplation_alteration_2', 'GlobalDoc'),
('GlobalDoc/Definition_modules', 'GlobalDoc'),
('GlobalDoc/Notes Analyses', 'GlobalDoc'),
('a1.wav', '.'), ('a2.wav', '.'), ('a3.wav', '.'), ('a4.wav', '.'), ('a5.wav', '.'),
('a6.wav', '.'), ('a7.wav', '.'), ('acc1.wav', '.'), ('acc2.wav', '.'), ('acc3.wav', '.'),
('acc4.wav', '.'), ('acc5.wav', '.'), ('acc6.wav', '.'), ('acc7.wav', '.'),
('p_w1.wav', '.'), ('p_w2.wav', '.')]
 
 
a = Analysis(
    ['GlobalApplis.spec'],
    pathex=[],
    binaries=[],
    datas=addedFiles,
    hiddenimports=[],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    win_no_prefer_redirects=False,
    win_private_assemblies=False,
    cipher=block_cipher,
    noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
 
 
exe = EXE(
    pyz,
    a.scripts,
    [],
    exclude_binaries=True,
    name='GlobalApplis',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    console=True,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
)
coll = COLLECT(
    exe,
    a.binaries,
    a.zipfiles,
    a.datas,
    strip=False,
    upx=True,
    upx_exclude=[],
    name='GlobalApplis',
)
Image : Éléments présents
Nom : DossiersPresentsDansDis.png
Affichages : 212
Taille : 187,4 Ko

Je serai content de trouver une aide ☺