【发布时间】:2019-06-15 15:36:51
【问题描述】:
SQL Server 2017 使用 sp_execute_external_script(SQL Server 机器学习)在数据库上下文中运行 python 脚本。 python 脚本需要从文件系统加载文件。一切(数据库和文件系统)在我的 PC 上都是本地的。错误跟踪:
Msg 39004, Niveau 16, État 20, Ligne 1
Une erreur de script « Python » s'est produite lors de l'execution de « sp_execute_external_script » avec HRESULT 0x80004004。
Msg 39019, Niveau 16, État 2, Ligne 1
Une erreur de script extern s'est produite :
执行错误。检查输出以获取更多信息。
Traceback(最近一次调用最后一次):
文件“”,第 5 行,在
文件“C:\PROGRA~1\MICROS~3\MSSQL1~2.MSS\MSSQL\EXTENS~1\MSSQLSERVER201701\B2E71FC7-8E08-4D86-8B82-38AD564DBC9D\sqlindb.py”,第 43 行,在变换中
im = Image.open(adresse_image)
文件“C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER2017\PYTHON_SERVICES\lib\site-packages\PIL\Image.py”,第 2410 行,打开
fp = builtins.open(filename, "rb")
PermissionError: [Errno 13] Permission denied: 'C:\Users\aubertl\Downloads\plage_corse_2.jpg'
SqlSatelliteCall 错误:执行错误。检查输出以获取更多信息。
消息 STDOUT 出处来自脚本外部:
Express Edition 将继续执行。
SqlSatelliteCall 函数失败。有关详细信息,请参阅控制台输出。
Traceback(最近一次调用最后一次):
文件“C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER2017\PYTHON_SERVICES\lib\site-packages\revoscalepy\computecontext\RxInSqlServer.py”,第 406 行,在 rx_sql_satellite_call 中
rx_native_call("SqlSatelliteCall", params)
文件“C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER2017\PYTHON_SERVICES\lib\site-packages\revoscalepy\RxSerializable.py”,第 291 行,在 rx_native_call 中
ret = px_call(functionname, params)
RuntimeError: revoscalepy 函数失败。
【问题讨论】:
标签: python sql-server