【问题标题】:PyInstaller gives the same encoding errorPyInstaller 给出相同的编码错误
【发布时间】:2018-07-02 01:30:14
【问题描述】:

当我尝试运行命令pyinstaller myscript.py 时,无论我的脚本包含什么,我都会收到以下错误,我尝试使用带有一行代码的脚本,例如x=1print('Hello')。一切都给出同样的错误。

139 信息:PyInstaller:3.3.1 139 信息:Python:3.6.4 140 信息: 平台:Windows-10-10.0.16299-SP0 Traceback(最后一次调用): 文件“c:\anaconda3\envs\py\lib\runpy.py”,第 193 行,在 _run_module_as_main "ma​​in", mod_spec) 文件“c:\anaconda3\envs\py\lib\runpy.py”,第 85 行,在 _run_code exec(code, run_globals) 文件“C:\Anaconda3\envs\py\Scripts\pyinstaller.exe__main__.py”,第 9 行,在 文件 “c:\anaconda3\envs\py\lib\site-packages\PyInstaller__main__.py”,行 92,运行中 spec_file = run_makespec(**vars(args)) 文件“c:\anaconda3\envs\py\lib\site-packages\PyInstaller__main__.py”,行 39,在 run_makespec spec_file = PyInstaller.building.makespec.main(filenames, **opts) 文件 "c:\anaconda3\envs\py\lib\site-packages\PyInstaller\building\makespec.py", 第 385 行,主要 specfile.write(onedirtmplt % d) 文件“c:\anaconda3\envs\py\lib\encodings\cp1252.py”,第 19 行,在编码中 return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in 位置 127-137:字符映射到

【问题讨论】:

    标签: python encoding pyinstaller


    【解决方案1】:

    脚本的路径包含一些非英文字符。

    【讨论】:

      猜你喜欢
      • 2022-09-27
      • 2021-09-05
      • 2020-07-10
      • 2018-04-14
      • 1970-01-01
      • 2016-09-22
      • 1970-01-01
      • 2012-06-16
      • 1970-01-01
      相关资源
      最近更新 更多