Bonjour,

J'ai développé un script Python en 3.X qui utilise le module xmlschema et j'ai en en-tête de ce script les imports suivants :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
import xmlschema
import elementpath
import os
J'utilise pyinstaller pour générer un exécutable, j'arrive à le générer mais l'exécutable ne marche pas car il semble qu'il manque des choses.
Voici la commande que je tape avec pyinstaller pour générer l'exécutable.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
pyinstaller --onefile checkXsd112.py -—hidden-import xmlschema --hidden-import elementpath --hidden-import os
Dans le répertoire Build, j'ai un fichier qui contient des warnings :
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
 
 
This file lists modules PyInstaller was not able to find. This does not
necessarily mean this module is required for running you program. Python and
Python 3rd-party packages include a lot of conditional or optional module. For
example the module 'ntpath' only exists on Windows, whereas the module
'posixpath' only exists on Posix systems.
 
Types if import:
* top-level: imported at the top-level - look at these first
* conditional: imported within an if-statement
* delayed: imported from within a function
* optional: imported within a try-except-statement
 
IMPORTANT: Do NOT post this list to the issue-tracker. Use it as a basis for
           yourself tracking down the missing module. Thanks!
 
missing module named resource - imported by posix (top-level), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named posix - imported by os (conditional, optional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named _posixsubprocess - imported by subprocess (conditional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named org - imported by pickle (optional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named readline - imported by cmd (delayed, conditional, optional), code (delayed, conditional, optional), pdb (delayed, optional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named lxml - imported by xmlschema.etree (delayed, conditional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named _winreg - imported by platform (delayed, optional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named java - imported by platform (delayed), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named 'java.lang' - imported by platform (delayed, optional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level), xml.sax._exceptions (conditional)
missing module named vms_lib - imported by platform (delayed, conditional, optional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named 'org.python' - imported by copy (optional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level), xml.sax (delayed, conditional)
missing module named termios - imported by tty (top-level), getpass (optional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named _scproxy - imported by urllib.request (conditional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named pwd - imported by posixpath (delayed, conditional), shutil (optional), tarfile (optional), http.server (delayed, optional), webbrowser (delayed), pathlib (delayed, conditional, optional), netrc (delayed, conditional), getpass (delayed), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named grp - imported by shutil (optional), tarfile (optional), pathlib (delayed), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named _dummy_threading - imported by dummy_threading (optional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), C:\xmlschema-master\test_xsd\checkXsd112.py (top-level)
Je ne comprends pas ce fichier, j'ai pourtant bien importé les 3 modules dans la ligne de commande de Pyinstaller.

Sauriez-vous comment générer un exécutable avec Pyinstaller en important xmlschema, os et elementpath ?

Merci.