@insomnia11

Ошибка кодировки при переходе в ехе pyinstaller,как спастись?

Привет всем! Перевожу скрипт на питоне в ехе с помощью pyinstaller.
Вышла такая ошибка,пытался найти символ-не вышло.
Подскажите,пожалуйста ,в чем может быть проблема?
Думал,что проблема в этом куске
f = open(str(fls) + ".txt", "w",encoding='utf-8')
                f.write(self.TextEdit.toPlainText())
                f.close()


C:\ry\GUI GMInd>pyinstaller.exe --onefile --windowed --icon = icon.ico GM2W.py
593 INFO: PyInstaller: 3.4
593 INFO: Python: 3.6.6
594 INFO: Platform: Windows-8.1-6.3.9600-SP0
675 INFO: wrote C:\ry\GUI GMInd\icon.spec
678 INFO: UPX is not available.
Traceback (most recent call last):
File "C:\Python36-32\Scripts\pyinstaller-script.py", line 11, in
load_entry_point('PyInstaller==3.4', 'console_scripts', 'pyinstaller')()
File "c:\python36-32\lib\site-packages\PyInstaller\__main__.py", line 111, in
run
run_build(pyi_config, spec_file, **vars(args))
File "c:\python36-32\lib\site-packages\PyInstaller\__main__.py", line 63, in r
un_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\python36-32\lib\site-packages\PyInstaller\building\build_main.py", li
ne 838, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'
))
File "c:\python36-32\lib\site-packages\PyInstaller\building\build_main.py", li
ne 784, in build
exec(text, spec_namespace)
File "", line 17, in
File "c:\python36-32\lib\site-packages\PyInstaller\building\build_main.py", li
ne 189, in __init__
raise ValueError("script '%s' not found" % script)
ValueError: script 'C:\ry\GUI GMInd\GM2W.py' not found

C:\ry\GUI GMInd>pyinstaller.exe --onefile --windowed --icon = icon.ico GM2W.pyw
134 INFO: PyInstaller: 3.4
135 INFO: Python: 3.6.6
136 INFO: Platform: Windows-8.1-6.3.9600-SP0
145 INFO: wrote C:\ry\GUI GMInd\icon.spec
148 INFO: UPX is not available.
151 INFO: Extending PYTHONPATH with paths
['C:\\ry\\GUI GMInd', 'C:\\ry\\GUI GMInd', 'C:\\ry\\GUI GMInd']
152 INFO: checking Analysis
153 INFO: Building Analysis because Analysis-00.toc is non existent
153 INFO: Initializing module dependency graph...
166 INFO: Initializing module graph hooks...
172 INFO: Analyzing base_library.zip ...
11289 INFO: running Analysis Analysis-00.toc
11343 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of
final executable
required by c:\python36-32\python.exe
12604 INFO: Caching module hooks...
12619 INFO: Analyzing C:\ry\GUI GMInd\icon.ico
Traceback (most recent call last):
File "C:\Python36-32\Scripts\pyinstaller-script.py", line 11, in
load_entry_point('PyInstaller==3.4', 'console_scripts', 'pyinstaller')()
File "c:\python36-32\lib\site-packages\PyInstaller\__main__.py", line 111, in
run
run_build(pyi_config, spec_file, **vars(args))
File "c:\python36-32\lib\site-packages\PyInstaller\__main__.py", line 63, in r
un_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\python36-32\lib\site-packages\PyInstaller\building\build_main.py", li
ne 838, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'
))
File "c:\python36-32\lib\site-packages\PyInstaller\building\build_main.py", li
ne 784, in build
exec(text, spec_namespace)
File "", line 17, in
File "c:\python36-32\lib\site-packages\PyInstaller\building\build_main.py", li
ne 241, in __init__
self.__postinit__()
File "c:\python36-32\lib\site-packages\PyInstaller\building\datastruct.py", li
ne 158, in __postinit__
self.assemble()
File "c:\python36-32\lib\site-packages\PyInstaller\building\build_main.py", li
ne 443, in assemble
priority_scripts.append(self.graph.run_script(script))
File "c:\python36-32\lib\site-packages\PyInstaller\depend\analysis.py", line 2
01, in run_script
self._top_script_node = super(PyiModuleGraph, self).run_script(pathname)
File "c:\python36-32\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph
.py", line 1335, in run_script
contents = fp.read() + '\n'
File "c:\python36-32\lib\codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 87: invalid
continuation byte
  • Вопрос задан
  • 1746 просмотров
Пригласить эксперта
Ответы на вопрос 1
@insomnia11 Автор вопроса
icon = app.ico ,а надо icon=app.ico
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы
28 нояб. 2024, в 18:46
3000 руб./за проект
28 нояб. 2024, в 17:46
10000 руб./за проект
28 нояб. 2024, в 17:38
12000 руб./за проект