环境:

window7 64bit

python 3.5

pyinstaller 3.2

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

  1. C:\Users\caoxin\PyInstaller-3.2>python pyinstaller.py --console --onefile main5.
  2. py
  3. 249 INFO: PyInstaller: 3.2
  4. 249 INFO: Python: 3.5.0
  5. 250 INFO: Platform: Windows-7-6.1.7601-SP1
  6. 252 INFO: wrote C:\Users\caoxin\PyInstaller-3.2\main5\main5.spec
  7. 253 INFO: UPX is not available.
  8. 256 INFO: Extending PYTHONPATH with paths
  9. ['C:\\Users\\caoxin\\PyInstaller-3.2',
  10. 'C:\\Users\\caoxin\\PyInstaller-3.2\\main5']
  11. 256 INFO: checking Analysis
  12. 256 INFO: Building Analysis because out00-Analysis.toc is non existent
  13. 258 INFO: Initializing module dependency graph...
  14. 259 INFO: Initializing module graph hooks...
  15. 262 INFO: Analyzing base_library.zip ...
  16. 2670 INFO: running Analysis out00-Analysis.toc
  17. 2746 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
  18. ms-win-crt-runtime-l1-1-0.dll
  19. Traceback (most recent call last):
  20. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
  21. 95, in getImports
  22. return _getImports_pe(pth)
  23. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
  24. 22, in _getImports_pe
  25. dll, _ = sym.forwarder.split('.')
  26. TypeError: a bytes-like object is required, not 'str'
  27. 2815 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
  28. ms-win-crt-stdio-l1-1-0.dll
  29. Traceback (most recent call last):
  30. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
  31. 95, in getImports
  32. return _getImports_pe(pth)
  33. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
  34. 22, in _getImports_pe
  35. dll, _ = sym.forwarder.split('.')
  36. TypeError: a bytes-like object is required, not 'str'
  37. 2819 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
  38. ms-win-crt-heap-l1-1-0.dll
  39. Traceback (most recent call last):
  40. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
  41. 95, in getImports
  42. return _getImports_pe(pth)
  43. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
  44. 22, in _getImports_pe
  45. dll, _ = sym.forwarder.split('.')
  46. TypeError: a bytes-like object is required, not 'str'
  47. 2829 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
  48. ms-win-crt-locale-l1-1-0.dll
  49. Traceback (most recent call last):
  50. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
  51. 95, in getImports
  52. return _getImports_pe(pth)
  53. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
  54. 22, in _getImports_pe
  55. dll, _ = sym.forwarder.split('.')
  56. TypeError: a bytes-like object is required, not 'str'
  57. 2864 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
  58. ms-win-crt-math-l1-1-0.dll
  59. Traceback (most recent call last):
  60. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
  61. 95, in getImports
  62. return _getImports_pe(pth)
  63. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
  64. 22, in _getImports_pe
  65. dll, _ = sym.forwarder.split('.')
  66. TypeError: a bytes-like object is required, not 'str'
  67. 3276 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
  68. ms-win-crt-string-l1-1-0.dll
  69. Traceback (most recent call last):
  70. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
  71. 95, in getImports
  72. return _getImports_pe(pth)
  73. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
  74. 22, in _getImports_pe
  75. dll, _ = sym.forwarder.split('.')
  76. TypeError: a bytes-like object is required, not 'str'
  77. 3292 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
  78. ms-win-crt-convert-l1-1-0.dll
  79. Traceback (most recent call last):
  80. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
  81. 95, in getImports
  82. return _getImports_pe(pth)
  83. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
  84. 22, in _getImports_pe
  85. dll, _ = sym.forwarder.split('.')
  86. TypeError: a bytes-like object is required, not 'str'
  87. 3298 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
  88. ms-win-crt-conio-l1-1-0.dll
  89. Traceback (most recent call last):
  90. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
  91. 95, in getImports
  92. return _getImports_pe(pth)
  93. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
  94. 22, in _getImports_pe
  95. dll, _ = sym.forwarder.split('.')
  96. TypeError: a bytes-like object is required, not 'str'
  97. 3305 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
  98. ms-win-crt-process-l1-1-0.dll
  99. Traceback (most recent call last):
  100. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
  101. 95, in getImports
  102. return _getImports_pe(pth)
  103. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
  104. 22, in _getImports_pe
  105. dll, _ = sym.forwarder.split('.')
  106. TypeError: a bytes-like object is required, not 'str'
  107. 3315 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
  108. ms-win-crt-time-l1-1-0.dll
  109. Traceback (most recent call last):
  110. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
  111. 95, in getImports
  112. return _getImports_pe(pth)
  113. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
  114. 22, in _getImports_pe
  115. dll, _ = sym.forwarder.split('.')
  116. TypeError: a bytes-like object is required, not 'str'
  117. 3319 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
  118. ms-win-crt-environment-l1-1-0.dll
  119. Traceback (most recent call last):
  120. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
  121. 95, in getImports
  122. return _getImports_pe(pth)
  123. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
  124. 22, in _getImports_pe
  125. dll, _ = sym.forwarder.split('.')
  126. TypeError: a bytes-like object is required, not 'str'
  127. 3331 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
  128. ms-win-crt-filesystem-l1-1-0.dll
  129. Traceback (most recent call last):
  130. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
  131. 95, in getImports
  132. return _getImports_pe(pth)
  133. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
  134. 22, in _getImports_pe
  135. dll, _ = sym.forwarder.split('.')
  136. TypeError: a bytes-like object is required, not 'str'
  137. 3332 INFO: Caching module hooks...
  138. 3337 INFO: Analyzing C:\Users\caoxin\PyInstaller-3.2\main5.py
  139. 3374 INFO: Loading module hooks...
  140. 3375 INFO: Loading module hook "hook-encodings.py"...
  141. 3384 INFO: Loading module hook "hook-pydoc.py"...
  142. 3384 INFO: Loading module hook "hook-xml.py"...
  143. 3602 INFO: Looking for ctypes DLLs
  144. 3602 INFO: Analyzing run-time hooks ...
  145. 3612 INFO: Looking for dynamic libraries
  146. 4173 WARNING: Can not get binary dependencies for file: C:\Windows\system32\api-
  147. ms-win-crt-utility-l1-1-0.dll
  148. Traceback (most recent call last):
  149. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 6
  150. 95, in getImports
  151. return _getImports_pe(pth)
  152. File "C:\Users\caoxin\PyInstaller-3.2\PyInstaller\depend\bindepend.py", line 1
  153. 22, in _getImports_pe
  154. dll, _ = sym.forwarder.split('.')
  155. TypeError: a bytes-like object is required, not 'str'
  156. 4332 INFO: Looking for eggs
  157. 4332 INFO: Using Python library C:\Users\caoxin\AppData\Local\Programs\Python\Py
  158. thon35\python35.dll
  159. 4334 INFO: Found binding redirects:
  160. []
  161. 4342 INFO: Warnings written to C:\Users\caoxin\PyInstaller-3.2\main5\build\main5
  162. \warnmain5.txt
  163. 4355 INFO: checking PYZ
  164. 4355 INFO: Building PYZ because out00-PYZ.toc is non existent
  165. 4357 INFO: Building PYZ (ZlibArchive) C:\Users\caoxin\PyInstaller-3.2\main5\buil
  166. d\main5\out00-PYZ.pyz
  167. 4900 INFO: checking PKG
  168. 4901 INFO: Building PKG because out00-PKG.toc is non existent
  169. 4901 INFO: Building PKG (CArchive) out00-PKG.pkg
  170. 6788 INFO: Bootloader C:\Users\caoxin\PyInstaller-3.2\PyInstaller\bootloader\Win
  171. dows-64bit\run.exe
  172. 6789 INFO: checking EXE
  173. 6789 INFO: Building EXE because out00-EXE.toc is non existent
  174. 6789 INFO: Building EXE from out00-EXE.toc
  175. 6789 INFO: Appending archive to EXE C:\Users\caoxin\PyInstaller-3.2\main5\dist\m
  176. ain5.exe

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

即直接执行:

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

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

  1. 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. java 测量运行时间 单位:毫秒

    import java.util.*; public class DiffDemo { public static void main(String args[]) { try { long star ...

  2. BASH if/while/until loop

    #/bin/bash ]; then counter=" counter1=" echo "for loop:" $); do echo $i done ); ...

  3. 618大促微服务、web、redis等的超时时间

    1. 最近因为大促原因线上服务不稳定,不稳定主要是redis经常超时并且数据为定时mGet方式获得 节点一多,所有服务节点同时获取数据访问量变大导致get取数据变慢因mGet会对数据进行锁住操作, 此 ...

  4. 洛谷.3437.[POI2006]TET-Tetris 3D(二维线段树)

    题目链接 下落一个d*s的方块,则要在这个平面区域找一个最高的h' 更新整个平面区域的值为h+h' 对于本题,维护最大高度h和all 对于平面的x轴维护一棵线段树t1,每个t1的节点维护对应y轴的两棵 ...

  5. C++ 随机数rand()和srand()

    标准函数库中函数rand()可以生成0~RAND_MAX之间的一个随机数,其中RAND_MAX 是stdlib.h中定义的一个整数,它与系统有关. 例如在我的机器上,RAND_MAX=32767.可以 ...

  6. 数据结构+算法面试100题~~~摘自CSDN

    数据结构+算法面试100题~~~摘自CSDN,作者July 1.把二元查找树转变成排序的双向链表(树) 题目:输入一棵二元查找树,将该二元查找树转换成一个排序的双向链表.要求不能创建任何新的结点,只调 ...

  7. Qt.Qt新安装之后出现Error while building/deploying (kit: Desktop Qt 5.7.0 GCC 64bit) When executing step "Make”

    出问题的环境: 操作系统: Ubuntu18.04 安装包: qt-opensource-linux-x64-5.8.0.run 现象: 新建一个Hello World项目, 试着运行, 出现以下提示 ...

  8. Android Studio下添加assets目录

    Android Studio下添加assets目录 分类: Android Studio2013-11-06 18:09 10872人阅读 评论(2) 收藏 举报 android studioasse ...

  9. [Android Pro] 关于Android 7.0无法进行https抓包的问题

    cp from  : https://www.cnblogs.com/wytings/p/6954293.html 在App进行数据请求的时候,如果每次都打印log去判断是一件很不“人性化”的操作行为 ...

  10. 解剖SQLSERVER 第一篇 数据库恢复软件商的黑幕(有删减版)

    解剖SQLSERVER 第一篇  数据库恢复软件商的黑幕(有删减版) 这一系列,我们一起来解剖SQLSERVER 在系列的第一篇文章里本人可能会得罪某些人,但是作为一位SQLSERVER MVP,在我 ...