我已经通过 py2exe 创建了我的 python 项目的 exe 文件,其中包含多个文件。当我在我的系统中运行这个 exe 文件时。它工作正常,但如果我把它放在另一个系统中,那么它会打开登录表单,然后它不会进入我在第二个 python 文件中编写的下一个窗口。它在日志文件中给了我以下错误。
Traceback (most recent call last):
File "login.py", line 246, in DataReader
File "subprocess.pyo", line 711, in __init__
File "subprocess.pyo", line 948, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified
我知道这是重复的问题,但我尝试了许多 stackoverflow 的解决方案,但我没有解决这个问题。有人帮我解决这个问题。
成功登录后,它将通过此代码转到 start.py 文件,但它不会出现上述错误。
subprocess.call(["python", "./start.py"])
提前致谢