Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello,

I developed a Python script in 3.X which uses the xmlschema module and I have in the header of this script the following imports:

import xmlschema
import elementpath
import os


I am using pyinstaller to generate an executable, I manage to generate it but the executable does not work because it seems to be missing things.
Here is the command I type with pyinstaller to generate the executable.

pyinstaller --onefile checkXsd112.py -—hidden-import xmlschema --hidden-import elementpath --hidden-import os


In the Build directory, I have a file that contains warnings:
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)


I don't understand this file, yet I imported the 3 modules in the command line of Pyinstaller.

Would you know how to generate an executable with Pyinstaller by importing xmlschema, os and elementpath?

Thanks.

What I have tried:

I have tried:
pyinstaller --onefile checkXsd112.py -—hidden-import xmlschema --hidden-import elementpath --hidden-import os
Posted
Updated 20-Dec-22 8:22am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900