当使用Python 3.7.2和PyInstaller 3.4时,会出现“TypeError: expected str, bytes or os.PathLike object, not NoneType”错误,解决办法是直接修改venv/Lib/site-packages/PyInstaller/depend/bindepend.py
文件,添加
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
到函数get_python_library_path
里面,修改后的内容如下所示:
def get_python_library_path():
"""
Find dynamic Python library that will be bundled with frozen executable.
NOTOE: This is a fallback option when Python library is probably linked
statically with the Python executable and we need to search more for it.
On Debian/Ubuntu this is the case.
Return full path to Python dynamic library or None when not found.
We need to know