.py转换为.exe时出现Pyinstaller错误

时间:2019-06-01 01:35:49

标签: python typeerror pyinstaller

每当我尝试将任何.py文件放入pyinstaller时,总是会收到错误消息TypeError: expected str, bytes or os.PathLike object, not NoneType,但我找不到任何有意义的修复程序。

我尝试过重新安装pyinstaller和其他文件。

我不认为有任何代码问题,因为无论我使用什么文件,这种情况都会发生

预期:已编译的exe文件。

实际结果: TypeError: expected str, bytes or os.PathLike object, not NoneType 错误,什么都没有编译

1 个答案:

答案 0 :(得分:0)

首先,使用pip uninstall pyinstaller完全卸载pyinstaller,然后删除C:/Users/<Username>/AppData/Roaming/Pyinstaller目录。

下一步,使用pip install -U pyinstaller安装pyinstaller。

如果仍然显示相同的错误,请尝试从bindepend.py目录中的here替换<Python path>\Lib\site-packages\PyInstaller\depend