如何使用pyinstaller修复将py转换为exe的编码错误

时间:2019-02-13 13:44:11

标签: python pyqt5 pyinstaller

我正在尝试将pyqt程序转换为exe文件。但这会导致编码错误。我该如何解决?

Traceback (most recent call last):
  File "C:\Users\SelamiDogan\AppData\Local\Programs\Python\Python36\Scripts\pyinstaller-script.py", line 11, in <module>
    load_entry_point('PyInstaller==3.4', 'console_scripts', 'pyinstaller')()
  File "c:\users\selamidogan\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\__main__.py", line 111, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\users\selamidogan\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\users\selamidogan\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 838, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "c:\users\selamidogan\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 784, in build
    exec(text, spec_namespace)
  File "<string>", line 17, in <module>
  File "c:\users\selamidogan\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 241, in __init__
    self.__postinit__()
  File "c:\users\selamidogan\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
    self.assemble()
  File "c:\users\selamidogan\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 603, in assemble
    self._write_graph_debug()
  File "c:\users\selamidogan\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 637, in _write_graph_debug
    self.graph.create_xref(fh)
  File "c:\users\selamidogan\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 3131, in create_xref
    print(entry % {"NAME": name,"CONTENT": content}, file=out)
  File "c:\users\selamidogan\appdata\local\programs\python\python36\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u015f' in position 17081: character maps to <undefined>

0 个答案:

没有答案