环境:

window7 64bit

python 3.5

pyinstaller 3.2

用pyinstaller 将python文件打包成exe文件的过程中,出现了如下的错误

C:\Users\caoxin\PyInstaller-3.2>python pyinstaller.py --console --onefile main5.
py
249 INFO: PyInstaller: 3.2
249 INFO: Python: 3.5.0
250 INFO: Platform: Windows-7-6.1.7601-SP1
252 INFO: wrote C:\Users\caoxin\PyInstaller-3.2\main5\main5.spec
253 INFO: UPX is not available.
256 INFO: Extending PYTHONPATH with paths
['C:\\Users\\caoxin\\PyInstaller-3.2',
'C:\\Users\\caoxin\\PyInstaller-3.2\\main5']
256 INFO: checking Analysis
256 INFO: Building Analysis because out00-Analysis.toc is non existent
258 INFO: Initializing module dependency graph...
259 INFO: Initializing module graph hooks...
262 INFO: Analyzing base_library.zip ...
2670 INFO: running Analysis out00-Analysis.toc
2746 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-runtime-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
95, in getImports
return _getImports_pe(pth)
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
22, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
2815 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-stdio-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
95, in getImports
return _getImports_pe(pth)
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
22, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
2819 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-heap-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
95, in getImports
return _getImports_pe(pth)
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
22, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
2829 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-locale-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
95, in getImports
return _getImports_pe(pth)
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
22, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
2864 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-math-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
95, in getImports
return _getImports_pe(pth)
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
22, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
3276 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-string-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
95, in getImports
return _getImports_pe(pth)
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
22, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
3292 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-convert-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
95, in getImports
return _getImports_pe(pth)
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
22, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
3298 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-conio-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
95, in getImports
return _getImports_pe(pth)
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
22, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
3305 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-process-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
95, in getImports
return _getImports_pe(pth)
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
22, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
3315 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-time-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
95, in getImports
return _getImports_pe(pth)
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
22, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
3319 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-environment-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
95, in getImports
return _getImports_pe(pth)
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
22, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
3331 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-filesystem-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
95, in getImports
return _getImports_pe(pth)
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
22, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
3332 INFO: Caching module hooks...
3337 INFO: Analyzing C:\Users\caoxin\PyInstaller-3.2\main5.py
3374 INFO: Loading module hooks...
3375 INFO: Loading module hook "hook-encodings.py"...
3384 INFO: Loading module hook "hook-pydoc.py"...
3384 INFO: Loading module hook "hook-xml.py"...
3602 INFO: Looking for ctypes DLLs
3602 INFO: Analyzing run-time hooks ...
3612 INFO: Looking for dynamic libraries
4173 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
ms-win-crt-utility-l1-1-0.dll
Traceback (most recent call last):
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
95, in getImports
return _getImports_pe(pth)
File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
22, in _getImports_pe
dll, _ = sym.forwarder.split('.')
TypeError: a bytes-like object is required, not 'str'
4332 INFO: Looking for eggs
4332 INFO: Using Python library C:\Users\caoxin\AppData\Local\Programs\Python\Py
thon35\python35.dll
4334 INFO: Found binding redirects:
[]
4342 INFO: Warnings written to C:\Users\caoxin\PyInstaller-3.2\main5\build\main5
\warnmain5.txt
4355 INFO: checking PYZ
4355 INFO: Building PYZ because out00-PYZ.toc is non existent
4357 INFO: Building PYZ (ZlibArchive) C:\Users\caoxin\PyInstaller-3.2\main5\buil
d\main5\out00-PYZ.pyz
4900 INFO: checking PKG
4901 INFO: Building PKG because out00-PKG.toc is non existent
4901 INFO: Building PKG (CArchive) out00-PKG.pkg
6788 INFO: Bootloader C:\Users\caoxin\PyInstaller-3.2\PyInstaller\bootloader\Win
dows-64bit\run.exe
6789 INFO: checking EXE
6789 INFO: Building EXE because out00-EXE.toc is non existent
6789 INFO: Building EXE from out00-EXE.toc
6789 INFO: Appending archive to EXE C:\Users\caoxin\PyInstaller-3.2\main5\dist\m
ain5.exe

通过google,找到最终的解决方案,原因是pyinstaller 3.2有bug,目前开发版本的pyinstaller解决了此bug,所以用pyinstaller-develop版本就可以将此问题解决。

即直接执行:

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

然后解压该安装包,进入解压的文件夹内执行

python pyinstaller.py --console --onefile main5.py

问题得到修复。

另外值得注意的一点,在Win7 64位的操作系统中,也要装python3.5 32位的安装包。具体原因如下:

参考网址:

WARNING: Can not get binary dependencies for file

Why isn't pyinstaller making me an .exe file?

WARNING: Can not get binary dependencies for file...的更多相关文章

  1. mac 连接mysql提示 Warning: mysqli::real_connect(): (HY000/2002): No such file or directory

    mac 连接mysql的时候提示 Warning: mysqli::real_connect(): (HY000/2002): No such file or directory [说明1]MAC下M ...

  2. The difference between text mode and binary mode with file streams

    FIO14-C. Understand the difference between text mode and binary mode with file streams     Skip to e ...

  3. Canal 同步异常分析:Could not find first log file name in binary log index file

    文章首发于[博客园-陈树义],点击跳转到原文Canal同步异常分析:Could not find first log file name in binary log index file. 公司搜索相 ...

  4. Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'系列一:

    从库报这个错误:Got fatal error 1236 from master when reading data from binary log: 'Could not find first lo ...

  5. nodejs -- fs模块 ---> readFile 函数 1) fs.readFile(filename, "binary", function(error, file) 2) response.write(file, "binary");

    一:代码: 1.1 入口文件: index.js var server = require('./server'); var router = require("./router" ...

  6. mysql从库Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'报错处理

    年后回来查看mysql运行状况与备份情况,登录mysql从库查看主从同步状态 mysql> show slave status\G; *************************** . ...

  7. 'Could not find first log file name in binary log index file'的解决办法

    数据库主从出错: Slave_IO_Running: No 一方面原因是因为网络通信的问题也有可能是日志读取错误的问题.以下是日志出错问题的解决方案: Last_IO_Error: Got fatal ...

  8. Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'

    setup slave from backup i got error Got fatal error 1236 from master when reading data from binary l ...

  9. warning no newline at the end of file

    main.c :10:2 warning: no newline at the end of file 修复这个警告,在文件结尾回车一下就行了.可以很少会有人去仔细探究,为什么gcc会给出这么一个警告 ...

随机推荐

  1. IPv6升级改造包括什么?

    关于IPv6技术升级具体做了什么,在我脑海里只是更换了域名解析的IP而已,所以找了这篇文章,帮助初步解惑. 原文地址:https://www.maczd.com/post/web-ipv6-upgra ...

  2. vue中的dom指令控制

    一.条件控制指令1.v-if,条件渲染 <div id="J_app"> <p v-if="show">显示该标签</p> ...

  3. 洛谷.1110.[ZJOI2007]报表统计(Multiset)

    题目链接 主要思路 /* 其实只需要multiset即可 对于询问1,删除.插入差值,输出最小元素 对于询问2,插入后用前驱后继更新 1.注意哨兵元素 2.注意multiset中删除时是删除某元素的一 ...

  4. BZOJ.4817.[SDOI2017]树点涂色(LCT DFS序 线段树)

    题目链接 操作\(1.2\)裸树剖,但是操作\(3\)每个点的答案\(val\)很不好维护.. 如果我们把同种颜色的点划分到同一连通块中,那么向根染色的过程就是Access()! 最初所有点间都是虚边 ...

  5. Eclipse中修改包名,提交SVN时报 is out of date,怎么办?

    问题:Eclipse中修改包名,提交SVN时报 is out of date,怎么办?描述: Hi,大家好! 我的问题如题,在不考虑用TortoiseSVN客户端直接删除目录这个方法的情况下,有什么方 ...

  6. android 6.0 动态权限

    Android 6.0 动态权限: 除了要在AndroidManifest.xml中申请外,还需使用时,请求用户允许授权. 以下是需要单独申请的权限,共分为9组,每组只要有一个权限申请成功了,就默认整 ...

  7. CocosCreator小栗子

    主要是了解了场景切换的API,见下: 开始场景和结束场景内,按钮挂相同的Btn脚本,主要是切换到场景2中: Btn脚本如下, onLoad:function() { this.node.on('mou ...

  8. win7 wamp 64位 php环境如何开启curl服务?

    这篇文章主要介绍了PHP简单开启curl的方法,较为详细的讲述了PHP开启curl函数库的具体步骤与相关注意事项,需要的朋友可以参考下 本文讲述了PHP简单开启curl的方法.分享给大家供大家参考,具 ...

  9. 慎用ArrayList的contains方法,使用HashSet的contains方法代替

    在启动一个应用的时候,发现其中有一处数据加载要数分钟,刚开始以为是需要load的数据比较多的缘故,查了一下数据库有6条左右,但是单独写了一个数据读取的方法,将这6万多条全部读过来,却只需要不到10秒钟 ...

  10. JavaScript 空间分析库——JSTS和Turf【转】

    https://blog.csdn.net/neimeng0/article/details/80363468 前言 项目中有管线的空间拓扑关系查询需求,在npm中检索到JSTS和Turf两个Java ...