python打包exe报错编码问题_python打包成exe,但执行exe报错,求解。

1、pycharm     pycharm-professional-2018.1.4.exe    已安装 64位的。

2、python       python-3.7.0.exe   已安装32位的。

3、随便写了一个小程序,RUN没有问题,代码如下:

#!/usr/bin/python

# -*- coding: utf-8 -*-

for i in range(1,5):

for j in range(1,5):

for k in range(1,5):

if(i!=k) and (i!=j) and (j!=k):

print (i,j,k)

4、使用inpystaller生成exe可执行文件

操作命令:inpystaller -F   C:\Users\T5000\PycharmProjects\untitled\asd.py

日志如下:

C:\Users\T5000>pyinstaller -F C:\Users\T5000\PycharmProjects\untitled\asd.py

78 INFO: PyInstaller: 3.3.1

78 INFO: Python: 3.7.0

78 INFO: Platform: Windows-10-10.0.17134-SP0

78 INFO: wrote C:\Users\T5000\asd.spec

93 INFO: UPX is not available.

93 INFO: Extending PYTHONPATH with paths

['C:\\Users\\T5000\\PycharmProjects\\untitled', 'C:\\Users\\T5000']

93 INFO: checking Analysis

93 INFO: Building Analysis because out00-Analysis.toc is non existent

93 INFO: Initializing module dependency graph...

109 INFO: Initializing module graph hooks...

109 INFO: Analyzing base_library.zip ...

3999 INFO: running Analysis out00-Analysis.toc

3999 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable

required by c:\users\t5000\appdata\local\programs\python\python37-32\python.exe

4358 WARNING: lib not found: api-ms-win-crt-process-l1-1-0.dll dependency of c:\users\t5000\appdata\local\programs\python\python37-32\python37.dll

4405 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:\users\t5000\appdata\local\programs\python\python37-32\python37.dll

5130 INFO: Caching module hooks...

5146 INFO: Analyzing C:\Users\T5000\PycharmProjects\untitled\asd.py

5146 INFO: Loading module hooks...

5146 INFO: Loading module hook "hook-encodings.py"...

5271 INFO: Loading module hook "hook-pydoc.py"...

5271 INFO: Loading module hook "hook-xml.py"...

5599 INFO: Looking for ctypes DLLs

5599 INFO: Analyzing run-time hooks ...

5614 INFO: Looking for dynamic libraries

6895 INFO: Looking for eggs

6895 INFO: Using Python library c:\users\t5000\appdata\local\programs\python\python37-32\python37.dll

6911 INFO: Found binding redirects:

[]

6911 INFO: Warnings written to C:\Users\T5000\build\asd\warnasd.txt

6973 INFO: Graph cross-reference written to C:\Users\T5000\build\asd\xref-asd.html

6989 INFO: checking PYZ

6989 INFO: Building PYZ because out00-PYZ.toc is non existent

6989 INFO: Building PYZ (ZlibArchive) C:\Users\T5000\build\asd\out00-PYZ.pyz

7646 INFO: Building PYZ (ZlibArchive) C:\Users\T5000\build\asd\out00-PYZ.pyz completed successfully.

7646 INFO: checking PKG

7646 INFO: Building PKG because out00-PKG.toc is non existent

7646 INFO: Building PKG (CArchive) out00-PKG.pkg

9505 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.

9520 INFO: Bootloader c:\users\t5000\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe

9520 INFO: checking EXE

9520 INFO: Building EXE because out00-EXE.toc is non existent

9520 INFO: Building EXE from out00-EXE.toc

9520 INFO: Appending archive to EXE C:\Users\T5000\dist\asd.exe

9520 INFO: Building EXE from out00-EXE.toc completed successfully.

5、找到生成的exe,执行此exe

C:\Users\T5000\dist\asd.exe

6、CMD报错

Fatal Python error: initfsencoding: unable to load the file system codec

zipimport.ZipImportError: can't find module 'encodings'

Current thread 0x00003370 (most recent call first):

求大神解决???????????

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值