无法与“ Python”脚本的运行时通信。请检查“ Python”运行时的要求

时间:2018-09-02 13:31:58

标签: python sql-server

有人知道如何在下面解决此错误吗?我正在使用SQL Server 2017在数据库中运行Python。应该已经正确设置了编码环境,并且直到上周为止都没有任何问题地运行代码,并且我没有对SQL Server进行任何更改。


示例代码:

exec sp_execute_external_script 
@language =N'Python',
@script=N'OutputDataSet = InputDataSet
print("Input data is {0}".format(InputDataSet))
', 
@input_data_1 = N'SELECT 1 as col'

错误消息:

Msg 39012, Level 16, State 1, Line 25
Unable to communicate with the runtime for 'Python' script. Please check the requirements of 'Python' runtime.
STDERR message(s) from external script: 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\PYTHON_SERVICES\lib\site-packages\revoscalepy\__init__.py", line 6, in <module>
    from .RxSerializable import RxMissingValues
  File "C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\PYTHON_SERVICES\lib\site-packages\revoscalepy\RxSerializable.py", line 11, in <module>
    from pandas import DataFrame
  File "C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\PYTHON_SERVICES\lib\site-packages\pandas\__init__.py", line 39, in <module>
    from pandas.core.api import *
  File "C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\PYTHON_SERVICES\lib\site-packages\pandas\core\api.py", line 10, in <module>
    from pandas.core.groupby import Grouper
  File "C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\PYTHON_SERVICES\lib\site-packages\pandas\core\groupby\__init__.py", line 2, in <module>

STDERR message(s) from external script: 
    from pandas.core.groupby.groupby import (
  File "C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\PYTHON_SERVICES\lib\site-packages\pandas\core\groupby\groupby.py", line 20, in <module>
    from pandas.core.dtypes.common import (
  File "C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\PYTHON_SERVICES\lib\site-packages\pandas\core\dtypes\common.py", line 17, in <module>
    from .inference import is_string_like, is_list_like
  File "C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017\PYTHON_SERVICES\lib\site-packages\pandas\core\dtypes\inference.py", line 8, in <module>
    from pandas.compat import (PY2, string_types, text_type,
ImportError: cannot import name 're_type'

0 个答案:

没有答案