Python 在用 Pyinstaller封装exe-TypeError: expected str, bytes or os.PathLike object, not NoneType 解决方法!

一、环境:

系统:win7

版本:Python 3.7.2  (32位)

二、问题:

利用Pyinstaller封装exe 时, 报错:TypeError: expected str, bytes or os.PathLike object, not NoneType

如下图:

三、解决方法:

1.这个问题,在GitHub上已提及 https://github.com/pyinstaller/pyinstaller/issues/3942 ; 被标记为 #3942 Error

2【真正解决方法:】 更新一下,我们电脑上Pyinstaller包 下的 bindepend.py 文件。 Pyinstaller 的工程师应该修复了这个bug,只要更新一个文件就行。

更新方法

A. 先官方 GitHub 下载Pyinstaller 包,地址: Pyinstaller GitHub 

B. 下载后,我们打开进入 路径: pyinstaller/PyInstaller/depend/bindepend.py     找到 bindepend.py 文件

C.下面是换更新,我们电脑上的  bindepend.py  这里我们用一个搜所工具 Everything!【自己百度下载】

   用Everything 搜索出所有的  bindepend.py  [可以先把旧的 bindepend.py 改名 bindepend_old.py, 再把新的复制进入] 如下图 :

 

   如图上,搜索出4个bindepend.py 替换成下载好的!!

四 、 完成

又可以愉快的,生成 exe了!!!

猜你喜欢

转载自www.cnblogs.com/Ultramantoo/p/11123684.html