This is a brand new SQL Server 2017 Enterprise install and patched to 14.0.3411.3. R services seem to be working or at least I can pull the packages and add new ones as per our developers requests.
However, while running the following code to see what python packages are loaded, I receive the following error.
EXECUTE sp_execute_external_script
@language = N'Python',
@script = N'
import pkg_resources
import pandas
OutputDataSet = pandas.DataFrame(sorted([(i.key, i.version) for i in pkg_resources.working_set]))'
WITH result sets((Package NVARCHAR(128), Version NVARCHAR(128)));
Error:
Msg 39004, Level 16, State 20, Line 0
A 'Python' script error occurred during execution of 'sp_execute_external_script' with HRESULT 0x80004004.
Msg 39019, Level 16, State 2, Line 0
An external script error occurred:
Error in execution. Check the output for more information.
Traceback (most recent call last):
File "<string>", line 5, in <module>
File "E:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\ExtensibilityData\MSSQLSERVER01\1500A68E-6964-46AA-BC6A-A2455462EA66\sqlindb.py", line 24, in transform
OutputDataSet = pandas.DataFrame()
UnboundLocalError: local variable 'pandas' referenced before assignment
SqlSatelliteCall error: Error in execution. Check the output for more information.
STDOUT message(s) from external script:
SqlSatelliteCall function failed. Please see the console output for more information.
Traceback (most recent call last):
File "D:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\revoscalepy\computecontext\RxInSqlServer.py", line 406, in rx_sql_satellite_call
rx_native_call("SqlSatelliteCall", params)
File "D:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\revoscalepy\RxSerializable.py", line 291, in rx_native_call
ret = px_call(functionname, params)
RuntimeError: revoscalepy function failed.
Thanks in advance.