Pyinstaller generated exe doesn't run with Windows Task Scheduler

跟風遠走 提交于 2019-12-02 09:48:34

A simple way to resolve this:

1. Find the python executable in your system.

import sys
print("Python EXE: " + sys.executable)

In my case: "C:\users\USER\appdata\local\continuum\anaconda3\python.exe"

2. Select the path to your python code.

In my case: "C:\Users\USER\Documents\SandBox\test.py"

3. Open a notepad and write: 'start PYTHONPATH SCRIPTPATH' as in:

start C:\users\USER\appdata\local\continuum\anaconda3\python.exe C:\Users\USER\Documents\SandBox\test.py

4. Save this notepad as .bat in somewhere.

5. Schedule this .bat

The system will properly run the bat which will run the script.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!