Python 脚本在 CMD 中手动执行但在调度程序中出错
Python Script Executes Manually in CMD but Errors in Scheduler
所以,我有一个 python 脚本,我可以 运行 在 cmd 中使用 python [脚本路径]
我在调度程序中设置了它,但它运行 没有通过调度程序并发现错误。 Cmd 在能够读取错误之前关闭。我创建了一个批处理文件来启动脚本,它显示了一个包不存在的错误 [lxml]。但是,该包存在,因为手动执行时脚本将 运行
有什么想法吗?
脚本从网站抓取数据,创建数据框,将数据框发布到 google sheet,然后提取它发布到的完整 google sheet,将其转换为包含所有数据的数据框,然后创建绘图图,将其转换为 html 文件,然后将 html 文件发送到 SFTP 服务器
想通了...
import sys
import platform
import imp
print("Python EXE : " + sys.executable)
print("Architecture : " + platform.architecture()[0])
#print("Path to arcpy : " + imp.find_module("arcpy")[1])
#raw_input("\n\nPress ENTER to quit")
运行 获取 Python.exe 的正确路径,并将其放在 Program/Script.
然后您需要验证脚本中的每个目录是否都从 C:/ 开始并通过完整路径运行。
所以,我有一个 python 脚本,我可以 运行 在 cmd 中使用 python [脚本路径]
我在调度程序中设置了它,但它运行 没有通过调度程序并发现错误。 Cmd 在能够读取错误之前关闭。我创建了一个批处理文件来启动脚本,它显示了一个包不存在的错误 [lxml]。但是,该包存在,因为手动执行时脚本将 运行
有什么想法吗?
脚本从网站抓取数据,创建数据框,将数据框发布到 google sheet,然后提取它发布到的完整 google sheet,将其转换为包含所有数据的数据框,然后创建绘图图,将其转换为 html 文件,然后将 html 文件发送到 SFTP 服务器
想通了...
import sys
import platform
import imp
print("Python EXE : " + sys.executable)
print("Architecture : " + platform.architecture()[0])
#print("Path to arcpy : " + imp.find_module("arcpy")[1])
#raw_input("\n\nPress ENTER to quit")
运行 获取 Python.exe 的正确路径,并将其放在 Program/Script.
然后您需要验证脚本中的每个目录是否都从 C:/ 开始并通过完整路径运行。