I’m trying to use cx_Freeze (https://pypi.org/project/cx-Freeze/) in a python app but running into an error message:
AttributeError: module 'cx_Freeze' has no attribute ‘BdistDMG’
On Aug 15, 2022, at 12:11 PM, David at Booomer <david@boomer.org> wrote:
I’m trying to use cx_Freeze (https://pypi.org/project/cx-Freeze/) in a python app but running into an error message:
AttributeError: module 'cx_Freeze' has no attribute ‘BdistDMG’
I’m using Anaconda and error appears with the import command: from cx_Freeze import *
From the terminal the command: python setup.py build gives much the same error.
I believe there is an issue specifying the output file name but don’t know how to resolve it.
Any suggestions, thanks. David
--
https://mail.python.org/mailman/listinfo/python-list
On Aug 15, 2022, at 5:51 PM, Jim Schwartz <jschwar@sbcglobal.net> wrote:
This link covers how to use BDist_dmg.
https://cx-freeze.readthedocs.io/en/latest/setup_script.html
Sent from my iPhone
On Aug 15, 2022, at 12:11 PM, David at Booomer <david@boomer.org> wrote:
I’m trying to use cx_Freeze (https://pypi.org/project/cx-Freeze/) in a python app but running into an error message:
AttributeError: module 'cx_Freeze' has no attribute ‘BdistDMG’
I’m using Anaconda and error appears with the import command: from cx_Freeze import *
From the terminal the command: python setup.py build gives much the same error.
I believe there is an issue specifying the output file name but don’t know how to resolve it.
Any suggestions, thanks. David
--
https://mail.python.org/mailman/listinfo/python-list
However I now get an error
init() takes from 2 to 12 positional arguments but 14 were given
I found a couple instances of init in two .py files that were part of the whole.
One .py file
def __init__(self):
From: Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject: Re: Problem using cx_Freeze
Date: August 15, 2022 at 8:18:54 PM MDT
To: python-list@python.org
On Mon, 15 Aug 2022 18:00:48 -0600, David at Booomer <david@boomer.org> declaimed the following:
However I now get an error
init() takes from 2 to 12 positional arguments but 14 were given
I found a couple instances of init in two .py files that were part of the whole.
One .py file
def __init__(self):
Please cut&paste the TEXT of the console where the errors are displayed -- don't paraphrase!
init() is NOT the same as __init__()
WHAT "One .py file"? This is a meaningless bit of information.
The most likely __init__() involved is the one where cx_Freeze.Executable is instantiated. https://cx-freeze.readthedocs.io/en/latest/setup_script.html#cx-freeze-executable
shows 11 parameters (and "self" would make the 12th).
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
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",
)
]
)
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 ).
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.
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",
)
I am/was worried about the trailing ‘,' after ',"speak.py”,’ <- but deleting it or moving it after the ] didn’t help.
On 2022-08-17 12:09:14 -0600, David at Booomer wrote:
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",[...]
)
I am/was worried about the trailing ‘,' after ',"speak.py”,’ <- but deleting it or moving it after the ] didn’t help.
This has nothing to do with your problem but:
Python allows a trailing comma in any comma-separated list of values. It
will just be ignored.
This is really common in modern programming languages (read: programming languages younger than 30 years or so), because it makes it much more convenient to extend/shorten/reorder a list. Otherwise you alway have to remember add or remove a comma in the right place. (Some people
(especially SQL programmers for some reason) resorted to put the comma
at the start of each line to get around this, which is really ugly.)
hp
--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
--
https://mail.python.org/mailman/listinfo/python-list
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 237:08:20 |
Calls: | 6,624 |
Files: | 12,172 |
Messages: | 5,319,873 |