Problem using cx_Freeze
David at Booomer
david at boomer.org
Wed Aug 17 14:09:14 EDT 2022
Hi Dennis
Thank you for your reply. I’m am trying to get LaTex-to-Speech (https://github.com/SGanesh19/LaTeX-to-Speech) to run as an accessibility aid, converting equations into speech. I haven’t used cx_Freeze before so stumbling somewhat.
The error returned is
File "/Users/duser/Documents/Win_ShareFolder/LaTeX-to-Speech-master/setup.py", line 9, in <module>
Executable(
TypeError: __init__() takes from 2 to 12 positional arguments but 14 were given
The setup.py file is currently
import cx_Freeze
# from cx_Freeze import *
from cx_Freeze import setup, Executable
setup(
name="Latex2Speech",
options = {'build_exe':{'packages':['gtts','pyglet','PyQt4']}},
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",
)
]
)
I am/was worried about the trailing ‘,' after ',"speak.py”,’ <- but deleting it or moving it after the ] didn’t help. Adding base = None also didn’t help.
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.
Thanks again for any suggestions.
David
> From: Dennis Lee Bieber <wlfraed at ix.netcom.com>
> Subject: Re: Problem using cx_Freeze
> Date: August 15, 2022 at 8:18:54 PM MDT
> To: python-list at python.org
>
>
> On Mon, 15 Aug 2022 18:00:48 -0600, David at Booomer <david at 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 at ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
More information about the Python-list
mailing list