简体   繁体   English

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

[英]Pyinstaller Error when converting .py to .exe

Whenever I try to put any .py file into pyinstaller I always get an error TypeError: expected str, bytes or os.PathLike object, not NoneType I havent been able to find any fixes that make sense. 每当我尝试将任何.py文件放入pyinstaller时,我总会得到一个错误TypeError: expected str, bytes or os.PathLike object, not NoneType我还没有找到任何有意义的修复。

Ive tried reinstalling pyinstaller and different files. 我试过重新安装pyinstaller和不同的文件。

I dont think there is any code problems since this occurs no matter what file I use 我不认为有任何代码问题,因为无论我使用什么文件都会发生这种情况

Expected: a compiled exe file. 预期:编译的exe文件。

Actual Result: TypeError: expected str, bytes or os.PathLike object, not NoneType error and nothing is compiled 实际结果: TypeError: expected str, bytes or os.PathLike object, not NoneType错误,没有编译任何内容

First, uninstall pyinstaller completely with pip uninstall pyinstaller then delete C:/Users/<Username>/AppData/Roaming/Pyinstaller directory. 首先,使用pip uninstall pyinstaller uninstall pyinstaller完全pip uninstall pyinstaller然后删除C:/Users/<Username>/AppData/Roaming/Pyinstaller目录。

Next Install pyinstaller with pip install -U pyinstaller . 下一步使用pip install -U pyinstaller

If still shows the same error try to replace bindepend.py from here in <Python path>\\Lib\\site-packages\\PyInstaller\\depend directory. 如果仍然显示同样的错误尝试更换bindepend.py这里<Python path>\\Lib\\site-packages\\PyInstaller\\depend目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python pyinstaller 将 py 转换为 exe 时出错 - Python pyinstaller error when converting py to exe 转换为.exe Pyinstaller时的Chromedriver路径错误 - Chromedriver Path Error when converting to .exe Pyinstaller 转换为exe时出现Python pyinstaller错误 - Python pyinstaller error when converting to exe 使用 pyinstaller 将 .py 转换为 .exe 文件 - Converting .py to .exe file using pyinstaller 使用 pyinstaller 将 .py 转换为 .exe 后缺少模块 - missing modules after converting .py to .exe with pyinstaller 使用pyinstaller和scipy模块将py文件转换为exe文件时出错。 知道可能是什么问题吗? - Error when converting py file to exe file using pyinstaller and scipy module. Any idea what could be the problem? 尝试使用Pyinstaller从.py脚本制作.exe时出现运行时错误 - Runtime error when trying to make a .exe from .py script with Pyinstaller 将.py文件转换为exe时出错 - Error when converting .py file to exe 使用 pyinstaller 将 .py 转换为 .exe 时出错(pyinstaller:找不到命令,mac) - Errors converting .py to .exe with pyinstaller (pyinstaller: command not found, mac) 使用 pyinstaller 将 python 文件转换为 an.exe 文件时出现 opencv 错误 - opencv error when converting a python file to an .exe file with pyinstaller
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM