Convert Python files to executableHow do I check whether a file exists without exceptions?Calling an external command in PythonWhat are metaclasses in Python?Finding the index of an item given a list containing it in PythonWhat is the difference between Python's list methods append and extend?How can I safely create a nested directory?Does Python have a ternary conditional operator?Convert bytes to a string?How do I list all files of a directory?Does Python have a string 'contains' substring method?

How to build suspense or so to establish and justify xenophobia of characters in the eyes of the reader?

What is wrong with this proof that symmetric matrices commute?

PhD - Well known professor or well known school?

What makes Ada the language of choice for the ISS's safety-critical systems?

When conversion from Integer to Single may lose precision

"You've got another thing coming" - translation into French

Does an ice chest packed full of frozen food need ice?

How is water heavier than petrol, even though its molecular weight is less than petrol?

Investing in a Roth IRA with a Personal Loan?

An average heaven where everyone has sexless golden bodies and is bored

How to officially communicate to a non-responsive colleague?

Implement Homestuck's Catenative Doomsday Dice Cascader

Arriving at the same result with the opposite hypotheses

Preventing Employees from either switching to Competitors or Opening Their Own Business

What could have caused a rear derailleur to end up in the back wheel suddenly?

What is the actual quality of machine translations?

Can the poison from Kingsmen be concocted?

Are DSA and ECDSA provably secure assuming DL security?

When 2-pentene reacts with HBr, what will be the major product?

How does an ordinary object become radioactive?

Was the output of the C64 SID chip 8 bit sound?

Was there a priest on the Titanic who stayed on the ship giving confession to as many as he could?

Can an Aarakocra use a shield while flying?

Watts vs. Volt Amps



Convert Python files to executable


How do I check whether a file exists without exceptions?Calling an external command in PythonWhat are metaclasses in Python?Finding the index of an item given a list containing it in PythonWhat is the difference between Python's list methods append and extend?How can I safely create a nested directory?Does Python have a ternary conditional operator?Convert bytes to a string?How do I list all files of a directory?Does Python have a string 'contains' substring method?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Python: 3.6.5



PyInstaller: 3.4



I have problems to convert my project into a executable using PyInstaller, Py2Exe and Auto-Py-To-Exe.
I wanna have just one file. I need my assets folder in my exe.
The command which was generated by Auto Py To Exe is:



pyinstaller -y -F -w -i "D:/Eigene Dateien/Documents/Coding/Python/hangman/icon.ico" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/images";"images/" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/sounds";"sounds/" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/words.txt";"." "D:/Eigene Dateien/Documents/Coding/Python/hangman/main.py"


If I use this in PowerShell it says:



In Zeile:1 Zeichen:175
+ ... nts/Coding/Python/hangman/assets/images";"images/" --add-data "D:/Eig ...
+ ~~~~~~~~
Unerwartetes Token "add-data" in Ausdruck oder Anweisung.
In Zeile:1 Zeichen:262
+ ... nts/Coding/Python/hangman/assets/sounds";"sounds/" --add-data "D:/Eig ...
+ ~~~~~~~~
Unerwartetes Token "add-data" in Ausdruck oder Anweisung.
In Zeile:1 Zeichen:344
+ ... ds.txt";"." "D:/Eigene Dateien/Documents/Coding/Python/hangman/main.p ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unerwartetes Token ""D:/Eigene Dateien/Documents/Coding/Python/hangman/main.py"" in Ausdruck oder Anweisung.
In Zeile:1 Zeichen:163
+ ... eien/Documents/Coding/Python/hangman/assets/images";"images/" --add-d ...
+ ~~~~~~~~~
Der Operator "--" kann nur für Variablen oder Eigenschaften verwendet werden.
In Zeile:1 Zeichen:250
+ ... eien/Documents/Coding/Python/hangman/assets/sounds";"sounds/" --add-d ...
+ ~~~~~~~~~
Der Operator "--" kann nur für Variablen oder Eigenschaften verwendet werden.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken


Sorry, some text is German :/



D:Eigene DateienDocumentsCodingPythonhangman>pyinstaller -y -F -w -i "D:/Eigene Dateien/Documents/Coding/Python/hangman/icon.ico" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/images";"images/" --add-data "D:/Eigene Dateien/Documents/Coding
/Python/hangman/assets/sounds";"sounds/" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/words.txt";"." "D:/Eigene Dateien/Documents/Coding/Python/hangman/main.py"
75 INFO: PyInstaller: 3.4
75 INFO: Python: 3.6.5
76 INFO: Platform: Windows-10-10.0.17134-SP0
77 INFO: wrote D:Eigene DateienDocumentsCodingPythonhangmanmain.spec
80 INFO: UPX is not available.
82 INFO: Extending PYTHONPATH with paths
['D:\Eigene Dateien\Documents\Coding\Python\hangman',
'D:\Eigene Dateien\Documents\Coding\Python\hangman']
82 INFO: checking Analysis
146 INFO: Appending 'datas' from .spec
151 INFO: checking PYZ
187 INFO: checking PKG
189 INFO: Building because toc changed
189 INFO: Building PKG (CArchive) PKG-00.pkg
410 WARNING: One binary added with two internal names.
410 WARNING: ('libGLESv2.dll',
'C:\users\meiss\appdata\local\programs\python\python36-32\lib\site-packages\PyQt5\Qt\bin\libGLESv2.dll',
'BINARY')
410 WARNING: was placed previously at
411 WARNING: ('PyQt5\Qt\bin\libGLESv2.dll',
'C:\users\meiss\appdata\local\programs\python\python36-32\lib\site-packages\PyQt5\Qt\bin\libGLESv2.dll',
'BINARY')
13466 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
13476 INFO: Bootloader c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbootloaderWindows-32bitrunw.exe
13476 INFO: checking EXE
13478 INFO: Building because console changed
13478 INFO: Building EXE from EXE-00.toc
13483 INFO: SRCPATH [('D:\Eigene Dateien\Documents\Coding\Python\hangman\icon.ico', None)]
13483 INFO: Updating icons from ['D:\Eigene Dateien\Documents\Coding\Python\hangman\icon.ico'] to C:UsersmeissAppDataLocalTemptmpiwaatz96
Traceback (most recent call last):
File "c:usersmeissappdatalocalprogramspythonpython36-32librunpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:usersmeissappdatalocalprogramspythonpython36-32librunpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:UsersmeissAppDataLocalProgramsPythonPython36-32Scriptspyinstaller.exe__main__.py", line 9, in <module>
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstaller__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstaller__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingbuild_main.py", line 838, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingbuild_main.py", line 784, in build
exec(text, spec_namespace)
File "<string>", line 32, in <module>
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingapi.py", line 433, in __init__
self.__postinit__()
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingdatastruct.py", line 158, in __postinit__
self.assemble()
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingapi.py", line 522, in assemble
icon.CopyIcons(tmpnm, self.icon)
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 177, in CopyIcons
return CopyIcons_FromIco(dstpath, [srcpath])
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 134, in CopyIcons_FromIco
for i, f in enumerate(icons):
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 104, in __init__
entry.fromfile(file)
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 65, in fromfile
self._fields_ = list(struct.unpack(self._format_, data))
struct.error: unpack requires a buffer of 16 bytes


This is the output in IntelliJ (english)










share|improve this question
























  • Can you run it in english?

    – Alec Alameddine
    Mar 24 at 16:30











  • I dont think pyinstaller has an add-data command ... edit the specfile that is generated to add to a.datas , and you can use Tree to walk and include entire directories as opposed to individual files

    – Joran Beasley
    Mar 24 at 16:39











  • Have you tried executing the command in Command Prompt (cmd.exe) instead of Powershell?

    – Xukrao
    Mar 24 at 16:40











  • @alec935 edit the post (ran in IntelliJ because I didn't know how to run in english)

    – MelanX
    Mar 24 at 16:41











  • @JoranBeasley According to the PyInstaller documentation --add-data is a valid argument.

    – Xukrao
    Mar 24 at 16:43

















0















Python: 3.6.5



PyInstaller: 3.4



I have problems to convert my project into a executable using PyInstaller, Py2Exe and Auto-Py-To-Exe.
I wanna have just one file. I need my assets folder in my exe.
The command which was generated by Auto Py To Exe is:



pyinstaller -y -F -w -i "D:/Eigene Dateien/Documents/Coding/Python/hangman/icon.ico" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/images";"images/" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/sounds";"sounds/" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/words.txt";"." "D:/Eigene Dateien/Documents/Coding/Python/hangman/main.py"


If I use this in PowerShell it says:



In Zeile:1 Zeichen:175
+ ... nts/Coding/Python/hangman/assets/images";"images/" --add-data "D:/Eig ...
+ ~~~~~~~~
Unerwartetes Token "add-data" in Ausdruck oder Anweisung.
In Zeile:1 Zeichen:262
+ ... nts/Coding/Python/hangman/assets/sounds";"sounds/" --add-data "D:/Eig ...
+ ~~~~~~~~
Unerwartetes Token "add-data" in Ausdruck oder Anweisung.
In Zeile:1 Zeichen:344
+ ... ds.txt";"." "D:/Eigene Dateien/Documents/Coding/Python/hangman/main.p ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unerwartetes Token ""D:/Eigene Dateien/Documents/Coding/Python/hangman/main.py"" in Ausdruck oder Anweisung.
In Zeile:1 Zeichen:163
+ ... eien/Documents/Coding/Python/hangman/assets/images";"images/" --add-d ...
+ ~~~~~~~~~
Der Operator "--" kann nur für Variablen oder Eigenschaften verwendet werden.
In Zeile:1 Zeichen:250
+ ... eien/Documents/Coding/Python/hangman/assets/sounds";"sounds/" --add-d ...
+ ~~~~~~~~~
Der Operator "--" kann nur für Variablen oder Eigenschaften verwendet werden.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken


Sorry, some text is German :/



D:Eigene DateienDocumentsCodingPythonhangman>pyinstaller -y -F -w -i "D:/Eigene Dateien/Documents/Coding/Python/hangman/icon.ico" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/images";"images/" --add-data "D:/Eigene Dateien/Documents/Coding
/Python/hangman/assets/sounds";"sounds/" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/words.txt";"." "D:/Eigene Dateien/Documents/Coding/Python/hangman/main.py"
75 INFO: PyInstaller: 3.4
75 INFO: Python: 3.6.5
76 INFO: Platform: Windows-10-10.0.17134-SP0
77 INFO: wrote D:Eigene DateienDocumentsCodingPythonhangmanmain.spec
80 INFO: UPX is not available.
82 INFO: Extending PYTHONPATH with paths
['D:\Eigene Dateien\Documents\Coding\Python\hangman',
'D:\Eigene Dateien\Documents\Coding\Python\hangman']
82 INFO: checking Analysis
146 INFO: Appending 'datas' from .spec
151 INFO: checking PYZ
187 INFO: checking PKG
189 INFO: Building because toc changed
189 INFO: Building PKG (CArchive) PKG-00.pkg
410 WARNING: One binary added with two internal names.
410 WARNING: ('libGLESv2.dll',
'C:\users\meiss\appdata\local\programs\python\python36-32\lib\site-packages\PyQt5\Qt\bin\libGLESv2.dll',
'BINARY')
410 WARNING: was placed previously at
411 WARNING: ('PyQt5\Qt\bin\libGLESv2.dll',
'C:\users\meiss\appdata\local\programs\python\python36-32\lib\site-packages\PyQt5\Qt\bin\libGLESv2.dll',
'BINARY')
13466 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
13476 INFO: Bootloader c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbootloaderWindows-32bitrunw.exe
13476 INFO: checking EXE
13478 INFO: Building because console changed
13478 INFO: Building EXE from EXE-00.toc
13483 INFO: SRCPATH [('D:\Eigene Dateien\Documents\Coding\Python\hangman\icon.ico', None)]
13483 INFO: Updating icons from ['D:\Eigene Dateien\Documents\Coding\Python\hangman\icon.ico'] to C:UsersmeissAppDataLocalTemptmpiwaatz96
Traceback (most recent call last):
File "c:usersmeissappdatalocalprogramspythonpython36-32librunpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:usersmeissappdatalocalprogramspythonpython36-32librunpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:UsersmeissAppDataLocalProgramsPythonPython36-32Scriptspyinstaller.exe__main__.py", line 9, in <module>
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstaller__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstaller__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingbuild_main.py", line 838, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingbuild_main.py", line 784, in build
exec(text, spec_namespace)
File "<string>", line 32, in <module>
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingapi.py", line 433, in __init__
self.__postinit__()
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingdatastruct.py", line 158, in __postinit__
self.assemble()
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingapi.py", line 522, in assemble
icon.CopyIcons(tmpnm, self.icon)
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 177, in CopyIcons
return CopyIcons_FromIco(dstpath, [srcpath])
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 134, in CopyIcons_FromIco
for i, f in enumerate(icons):
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 104, in __init__
entry.fromfile(file)
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 65, in fromfile
self._fields_ = list(struct.unpack(self._format_, data))
struct.error: unpack requires a buffer of 16 bytes


This is the output in IntelliJ (english)










share|improve this question
























  • Can you run it in english?

    – Alec Alameddine
    Mar 24 at 16:30











  • I dont think pyinstaller has an add-data command ... edit the specfile that is generated to add to a.datas , and you can use Tree to walk and include entire directories as opposed to individual files

    – Joran Beasley
    Mar 24 at 16:39











  • Have you tried executing the command in Command Prompt (cmd.exe) instead of Powershell?

    – Xukrao
    Mar 24 at 16:40











  • @alec935 edit the post (ran in IntelliJ because I didn't know how to run in english)

    – MelanX
    Mar 24 at 16:41











  • @JoranBeasley According to the PyInstaller documentation --add-data is a valid argument.

    – Xukrao
    Mar 24 at 16:43













0












0








0








Python: 3.6.5



PyInstaller: 3.4



I have problems to convert my project into a executable using PyInstaller, Py2Exe and Auto-Py-To-Exe.
I wanna have just one file. I need my assets folder in my exe.
The command which was generated by Auto Py To Exe is:



pyinstaller -y -F -w -i "D:/Eigene Dateien/Documents/Coding/Python/hangman/icon.ico" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/images";"images/" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/sounds";"sounds/" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/words.txt";"." "D:/Eigene Dateien/Documents/Coding/Python/hangman/main.py"


If I use this in PowerShell it says:



In Zeile:1 Zeichen:175
+ ... nts/Coding/Python/hangman/assets/images";"images/" --add-data "D:/Eig ...
+ ~~~~~~~~
Unerwartetes Token "add-data" in Ausdruck oder Anweisung.
In Zeile:1 Zeichen:262
+ ... nts/Coding/Python/hangman/assets/sounds";"sounds/" --add-data "D:/Eig ...
+ ~~~~~~~~
Unerwartetes Token "add-data" in Ausdruck oder Anweisung.
In Zeile:1 Zeichen:344
+ ... ds.txt";"." "D:/Eigene Dateien/Documents/Coding/Python/hangman/main.p ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unerwartetes Token ""D:/Eigene Dateien/Documents/Coding/Python/hangman/main.py"" in Ausdruck oder Anweisung.
In Zeile:1 Zeichen:163
+ ... eien/Documents/Coding/Python/hangman/assets/images";"images/" --add-d ...
+ ~~~~~~~~~
Der Operator "--" kann nur für Variablen oder Eigenschaften verwendet werden.
In Zeile:1 Zeichen:250
+ ... eien/Documents/Coding/Python/hangman/assets/sounds";"sounds/" --add-d ...
+ ~~~~~~~~~
Der Operator "--" kann nur für Variablen oder Eigenschaften verwendet werden.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken


Sorry, some text is German :/



D:Eigene DateienDocumentsCodingPythonhangman>pyinstaller -y -F -w -i "D:/Eigene Dateien/Documents/Coding/Python/hangman/icon.ico" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/images";"images/" --add-data "D:/Eigene Dateien/Documents/Coding
/Python/hangman/assets/sounds";"sounds/" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/words.txt";"." "D:/Eigene Dateien/Documents/Coding/Python/hangman/main.py"
75 INFO: PyInstaller: 3.4
75 INFO: Python: 3.6.5
76 INFO: Platform: Windows-10-10.0.17134-SP0
77 INFO: wrote D:Eigene DateienDocumentsCodingPythonhangmanmain.spec
80 INFO: UPX is not available.
82 INFO: Extending PYTHONPATH with paths
['D:\Eigene Dateien\Documents\Coding\Python\hangman',
'D:\Eigene Dateien\Documents\Coding\Python\hangman']
82 INFO: checking Analysis
146 INFO: Appending 'datas' from .spec
151 INFO: checking PYZ
187 INFO: checking PKG
189 INFO: Building because toc changed
189 INFO: Building PKG (CArchive) PKG-00.pkg
410 WARNING: One binary added with two internal names.
410 WARNING: ('libGLESv2.dll',
'C:\users\meiss\appdata\local\programs\python\python36-32\lib\site-packages\PyQt5\Qt\bin\libGLESv2.dll',
'BINARY')
410 WARNING: was placed previously at
411 WARNING: ('PyQt5\Qt\bin\libGLESv2.dll',
'C:\users\meiss\appdata\local\programs\python\python36-32\lib\site-packages\PyQt5\Qt\bin\libGLESv2.dll',
'BINARY')
13466 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
13476 INFO: Bootloader c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbootloaderWindows-32bitrunw.exe
13476 INFO: checking EXE
13478 INFO: Building because console changed
13478 INFO: Building EXE from EXE-00.toc
13483 INFO: SRCPATH [('D:\Eigene Dateien\Documents\Coding\Python\hangman\icon.ico', None)]
13483 INFO: Updating icons from ['D:\Eigene Dateien\Documents\Coding\Python\hangman\icon.ico'] to C:UsersmeissAppDataLocalTemptmpiwaatz96
Traceback (most recent call last):
File "c:usersmeissappdatalocalprogramspythonpython36-32librunpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:usersmeissappdatalocalprogramspythonpython36-32librunpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:UsersmeissAppDataLocalProgramsPythonPython36-32Scriptspyinstaller.exe__main__.py", line 9, in <module>
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstaller__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstaller__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingbuild_main.py", line 838, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingbuild_main.py", line 784, in build
exec(text, spec_namespace)
File "<string>", line 32, in <module>
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingapi.py", line 433, in __init__
self.__postinit__()
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingdatastruct.py", line 158, in __postinit__
self.assemble()
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingapi.py", line 522, in assemble
icon.CopyIcons(tmpnm, self.icon)
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 177, in CopyIcons
return CopyIcons_FromIco(dstpath, [srcpath])
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 134, in CopyIcons_FromIco
for i, f in enumerate(icons):
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 104, in __init__
entry.fromfile(file)
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 65, in fromfile
self._fields_ = list(struct.unpack(self._format_, data))
struct.error: unpack requires a buffer of 16 bytes


This is the output in IntelliJ (english)










share|improve this question
















Python: 3.6.5



PyInstaller: 3.4



I have problems to convert my project into a executable using PyInstaller, Py2Exe and Auto-Py-To-Exe.
I wanna have just one file. I need my assets folder in my exe.
The command which was generated by Auto Py To Exe is:



pyinstaller -y -F -w -i "D:/Eigene Dateien/Documents/Coding/Python/hangman/icon.ico" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/images";"images/" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/sounds";"sounds/" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/words.txt";"." "D:/Eigene Dateien/Documents/Coding/Python/hangman/main.py"


If I use this in PowerShell it says:



In Zeile:1 Zeichen:175
+ ... nts/Coding/Python/hangman/assets/images";"images/" --add-data "D:/Eig ...
+ ~~~~~~~~
Unerwartetes Token "add-data" in Ausdruck oder Anweisung.
In Zeile:1 Zeichen:262
+ ... nts/Coding/Python/hangman/assets/sounds";"sounds/" --add-data "D:/Eig ...
+ ~~~~~~~~
Unerwartetes Token "add-data" in Ausdruck oder Anweisung.
In Zeile:1 Zeichen:344
+ ... ds.txt";"." "D:/Eigene Dateien/Documents/Coding/Python/hangman/main.p ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unerwartetes Token ""D:/Eigene Dateien/Documents/Coding/Python/hangman/main.py"" in Ausdruck oder Anweisung.
In Zeile:1 Zeichen:163
+ ... eien/Documents/Coding/Python/hangman/assets/images";"images/" --add-d ...
+ ~~~~~~~~~
Der Operator "--" kann nur für Variablen oder Eigenschaften verwendet werden.
In Zeile:1 Zeichen:250
+ ... eien/Documents/Coding/Python/hangman/assets/sounds";"sounds/" --add-d ...
+ ~~~~~~~~~
Der Operator "--" kann nur für Variablen oder Eigenschaften verwendet werden.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken


Sorry, some text is German :/



D:Eigene DateienDocumentsCodingPythonhangman>pyinstaller -y -F -w -i "D:/Eigene Dateien/Documents/Coding/Python/hangman/icon.ico" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/images";"images/" --add-data "D:/Eigene Dateien/Documents/Coding
/Python/hangman/assets/sounds";"sounds/" --add-data "D:/Eigene Dateien/Documents/Coding/Python/hangman/assets/words.txt";"." "D:/Eigene Dateien/Documents/Coding/Python/hangman/main.py"
75 INFO: PyInstaller: 3.4
75 INFO: Python: 3.6.5
76 INFO: Platform: Windows-10-10.0.17134-SP0
77 INFO: wrote D:Eigene DateienDocumentsCodingPythonhangmanmain.spec
80 INFO: UPX is not available.
82 INFO: Extending PYTHONPATH with paths
['D:\Eigene Dateien\Documents\Coding\Python\hangman',
'D:\Eigene Dateien\Documents\Coding\Python\hangman']
82 INFO: checking Analysis
146 INFO: Appending 'datas' from .spec
151 INFO: checking PYZ
187 INFO: checking PKG
189 INFO: Building because toc changed
189 INFO: Building PKG (CArchive) PKG-00.pkg
410 WARNING: One binary added with two internal names.
410 WARNING: ('libGLESv2.dll',
'C:\users\meiss\appdata\local\programs\python\python36-32\lib\site-packages\PyQt5\Qt\bin\libGLESv2.dll',
'BINARY')
410 WARNING: was placed previously at
411 WARNING: ('PyQt5\Qt\bin\libGLESv2.dll',
'C:\users\meiss\appdata\local\programs\python\python36-32\lib\site-packages\PyQt5\Qt\bin\libGLESv2.dll',
'BINARY')
13466 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
13476 INFO: Bootloader c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbootloaderWindows-32bitrunw.exe
13476 INFO: checking EXE
13478 INFO: Building because console changed
13478 INFO: Building EXE from EXE-00.toc
13483 INFO: SRCPATH [('D:\Eigene Dateien\Documents\Coding\Python\hangman\icon.ico', None)]
13483 INFO: Updating icons from ['D:\Eigene Dateien\Documents\Coding\Python\hangman\icon.ico'] to C:UsersmeissAppDataLocalTemptmpiwaatz96
Traceback (most recent call last):
File "c:usersmeissappdatalocalprogramspythonpython36-32librunpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:usersmeissappdatalocalprogramspythonpython36-32librunpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:UsersmeissAppDataLocalProgramsPythonPython36-32Scriptspyinstaller.exe__main__.py", line 9, in <module>
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstaller__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstaller__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingbuild_main.py", line 838, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingbuild_main.py", line 784, in build
exec(text, spec_namespace)
File "<string>", line 32, in <module>
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingapi.py", line 433, in __init__
self.__postinit__()
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingdatastruct.py", line 158, in __postinit__
self.assemble()
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerbuildingapi.py", line 522, in assemble
icon.CopyIcons(tmpnm, self.icon)
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 177, in CopyIcons
return CopyIcons_FromIco(dstpath, [srcpath])
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 134, in CopyIcons_FromIco
for i, f in enumerate(icons):
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 104, in __init__
entry.fromfile(file)
File "c:usersmeissappdatalocalprogramspythonpython36-32libsite-packagesPyInstallerutilswin32icon.py", line 65, in fromfile
self._fields_ = list(struct.unpack(self._format_, data))
struct.error: unpack requires a buffer of 16 bytes


This is the output in IntelliJ (english)







python python-3.x windows pyinstaller py2exe






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 17:06







MelanX

















asked Mar 24 at 16:21









MelanXMelanX

62




62












  • Can you run it in english?

    – Alec Alameddine
    Mar 24 at 16:30











  • I dont think pyinstaller has an add-data command ... edit the specfile that is generated to add to a.datas , and you can use Tree to walk and include entire directories as opposed to individual files

    – Joran Beasley
    Mar 24 at 16:39











  • Have you tried executing the command in Command Prompt (cmd.exe) instead of Powershell?

    – Xukrao
    Mar 24 at 16:40











  • @alec935 edit the post (ran in IntelliJ because I didn't know how to run in english)

    – MelanX
    Mar 24 at 16:41











  • @JoranBeasley According to the PyInstaller documentation --add-data is a valid argument.

    – Xukrao
    Mar 24 at 16:43

















  • Can you run it in english?

    – Alec Alameddine
    Mar 24 at 16:30











  • I dont think pyinstaller has an add-data command ... edit the specfile that is generated to add to a.datas , and you can use Tree to walk and include entire directories as opposed to individual files

    – Joran Beasley
    Mar 24 at 16:39











  • Have you tried executing the command in Command Prompt (cmd.exe) instead of Powershell?

    – Xukrao
    Mar 24 at 16:40











  • @alec935 edit the post (ran in IntelliJ because I didn't know how to run in english)

    – MelanX
    Mar 24 at 16:41











  • @JoranBeasley According to the PyInstaller documentation --add-data is a valid argument.

    – Xukrao
    Mar 24 at 16:43
















Can you run it in english?

– Alec Alameddine
Mar 24 at 16:30





Can you run it in english?

– Alec Alameddine
Mar 24 at 16:30













I dont think pyinstaller has an add-data command ... edit the specfile that is generated to add to a.datas , and you can use Tree to walk and include entire directories as opposed to individual files

– Joran Beasley
Mar 24 at 16:39





I dont think pyinstaller has an add-data command ... edit the specfile that is generated to add to a.datas , and you can use Tree to walk and include entire directories as opposed to individual files

– Joran Beasley
Mar 24 at 16:39













Have you tried executing the command in Command Prompt (cmd.exe) instead of Powershell?

– Xukrao
Mar 24 at 16:40





Have you tried executing the command in Command Prompt (cmd.exe) instead of Powershell?

– Xukrao
Mar 24 at 16:40













@alec935 edit the post (ran in IntelliJ because I didn't know how to run in english)

– MelanX
Mar 24 at 16:41





@alec935 edit the post (ran in IntelliJ because I didn't know how to run in english)

– MelanX
Mar 24 at 16:41













@JoranBeasley According to the PyInstaller documentation --add-data is a valid argument.

– Xukrao
Mar 24 at 16:43





@JoranBeasley According to the PyInstaller documentation --add-data is a valid argument.

– Xukrao
Mar 24 at 16:43












1 Answer
1






active

oldest

votes


















0














I have had some luck by downgrading Pyinstaller to version 3.1. pip install pyinstaller==3.1






share|improve this answer























  • For me it doesn't work :(

    – MelanX
    Mar 24 at 17:05











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325904%2fconvert-python-files-to-executable%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I have had some luck by downgrading Pyinstaller to version 3.1. pip install pyinstaller==3.1






share|improve this answer























  • For me it doesn't work :(

    – MelanX
    Mar 24 at 17:05















0














I have had some luck by downgrading Pyinstaller to version 3.1. pip install pyinstaller==3.1






share|improve this answer























  • For me it doesn't work :(

    – MelanX
    Mar 24 at 17:05













0












0








0







I have had some luck by downgrading Pyinstaller to version 3.1. pip install pyinstaller==3.1






share|improve this answer













I have had some luck by downgrading Pyinstaller to version 3.1. pip install pyinstaller==3.1







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 24 at 16:50









Mike C.Mike C.

486519




486519












  • For me it doesn't work :(

    – MelanX
    Mar 24 at 17:05

















  • For me it doesn't work :(

    – MelanX
    Mar 24 at 17:05
















For me it doesn't work :(

– MelanX
Mar 24 at 17:05





For me it doesn't work :(

– MelanX
Mar 24 at 17:05



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325904%2fconvert-python-files-to-executable%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현