修复pyinstaller打包报错
环境:win10,PyCharm 2019.1.1 x64 ,phthon3.7,pyinstaller3.4
想使用pyinstaller打包发布成exe,报错
TypeError: expected str, bytes or os.PathLike object, not NoneType
解决方法是找到项目根目录下\venv\Lib\site-packages\PyInstaller\depend\bindepend.py这个文件打开修改,
搜索“Applies only to non Windows platforms”,在后面添加
if is_win and ‘VERSION.dll’ in dlls:
pydll = ‘python%d%d.dll’ % sys.version_info[:2]
if pydll in PYDYLIB_NAMES:
filename = getfullnameof(pydll)
return filename
插入代码后如下图
嫌麻烦的同学可以点这里下载替换bindepend.py