Problem using cx_Freeze

Dennis Lee Bieber wlfraed at ix.netcom.com
Wed Aug 17 15:36:10 EDT 2022


On Wed, 17 Aug 2022 12:09:14 -0600, David at Booomer <david at boomer.org>
declaimed the following:

>    executables=[
>        Executable(
>            "prjui.py","Maiui.py","about.py","dict.py","geometry.py","getEquation.py",
>            "gtrail.py","main.py","matchingstring.py","producelatex.py","readfile.py",
>            "separete.py","speak.py",
>        )
>    ]
>)
>
	You are defining a list "executables" with only ONE member... (and is
that really how you spelled "separate").

>Searching for ‘__init__(' in the 13 *.py files returned five lines in two files (algorithm.py and prjui.py). As mentioned searching for this error only produced mention of adding self which is in these lines already. Previously I had search for __init__() which returned no lines due to the closing ).
>
	You are still searching the wrong place... The __init__() that is
complaining is the one in cx_Freeze.Executable().

>I had visited the page you provided (https://cx-freeze.readthedocs.io/en/latest/setup_script.html#cx-freeze-executable) but didn’t noticed the 11 plus self as 12 arguments.

	Really? Please count (reformatted from cut&paste):
"""
argument name				description

#1
script						the name of the file containing the script
which is to be frozen

#2
init_script					the name of the initialization script that will
be executed before the actual script is executed; this script is used to
set up the environment for the executable; if a name is given without an
absolute path the names of files in the initscripts subdirectory of the
cx_Freeze package is searched

#3
base						the name of the base executable; if a name is
given without an absolute path the names of files in the bases subdirectory
of the cx_Freeze package is searched

#4
target_name				the name of the target executable; the default
value is the name of the script; the extension is optional (automatically
added on Windows); support for names with version; if specified a pathname,
raise an error.

#5
icon						name of icon which should be included in the
executable itself on Windows or placed in the target directory for other
platforms (ignored in Microsoft Store Python app)

#6
manifest					name of manifest which should be included in
the executable itself (Windows only - ignored by Python app from Microsoft
Store)

#7
uac-admin					creates a manifest for an application that will
request elevation (Windows only - ignored by Python app from Microsoft
Store)

#8
shortcut_name				the name to give a shortcut for the executable
when included in an MSI package (Windows only).

#9
shortcut_dir					the directory in which to place the
shortcut when being installed by an MSI package; see the MSI Shortcut table
documentation for more information on what values can be placed here
(Windows only).

#10
copyright					the copyright value to include in the version
resource associated with executable (Windows only).

#11
trademarks					the trademarks value to include in the version
resource associated with the executable (Windows only).
"""

	You are passing 13 .py file names. There are only two arguments that
really want file names: script, and init_script. Most of the other
arguments are either optional or Windows specific (#6-11).

	I suspect you need to pass JUST main.py or Maiui.py (based on casing)
-- which ever is really the file you'd invoke to start the program running.
I'd hope the freeze system then scans (recursively) that file to find
anything imported, and include those in the final product.


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed at ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/


More information about the Python-list mailing list