WARNING: Can not get binary dependencies for file...

环境:
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版本就可以将此问题解决。
444975-20170213083952254-1328915694.png

即直接执行:

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

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

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

问题得到修复。

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

参考网址:

WARNING: Can not get binary dependencies for file
Why isn't pyinstaller making me an .exe file?

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值