Hey,
I have been doing Python 3.6 development for some time. I am using Anaconda and my install directory is:
C:\Users\Charles\Anaconda3\python.exe.
Last week I downloaded SQL Server 2017 Developer Edition and installed it on this machine (Windows 10, Intel I7 x64). The install path was
S:\SQL_Server_2017\MSSQL14.HEDGETOOLS\
I am using xgboost in my work and from a cmd shell, I ran
S:\SQL_Server_2017\MSSQL14.HEDGETOOLS\PYTHON_SERVICES\Scripts>conda list | findstr xgboost
and the xgboost package was not found. I then ran ran
conda install -c anaconda py-xgboost
and the package was installed.
I then started MSSC to create the following python script:
EXEC sp_execute_external_script @language = N'Python',
@script = N'
import xgboost
print("done.")
';
GO
When I executed the script I got:
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 "S:\SQL_Server_2017\MSSQL14.HEDGETOOLS\MSSQL\ExtensibilityData\HEDGETOOLS01\5AE42737-FB6F-4B35-9675-63E252C9E219\sqlindb.py", line 31, in transform
import xgboost
File "S:\SQL_Server_2017\MSSQL14.HEDGETOOLS\PYTHON_SERVICES\lib\site-packages\xgboost\__init__.py", line 11, in <module>
from .core import DMatrix, Booster
File "S:\SQL_Server_2017\MSSQL14.HEDGETOOLS\PYTHON_SERVICES\lib\site-packages\xgboost\core.py", line 115, in <module>
_LIB = _load_lib()
File "S:\SQL_Server_2017\MSSQL14.HEDGETOOLS\PYTHON_SERVICES\lib\site-packages\xgboost\core.py", line 109, in _load_lib
lib = ctypes.cdll.LoadLibrary(lib_path[0])
File "S:\SQL_Server_2017\MSSQL14.HEDGETOOLS\PYTHON_SERVICES\lib\ctypes\__init__.py", line 429, in LoadLibrary
return self._dlltype(name)
Msg 39019, Level 16, State 2, Line 0
An external script error occurred:
File "S:\SQL_Server_2017\MSSQL14.HEDGETOOLS\PYTHON_SERVICES\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
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 "S:\SQL_Server_2017\MSSQL14.HEDGETOOLS\PYTHON_SERVICES\lib\site-packages\revoscalepy\computecontext\RxInSqlServer.py", line 406, in rx_sql_satellite_call
rx_native_call("SqlSatelliteCall", params)
File "S:\SQL_Server_2017\MSSQL14.HEDGETOOLS\PYTHON_SERVICES\lib\site-packages\revoscalepy\RxSerializable.py", line 291, in rx_native_call
ret = px_call(functionname, params)
RuntimeError: revoscalepy function failed.
I don't have any python environments but my original installation of python set environment variables the point to my original installation:
PYTHONPATH C:\Users\Charles\Anaconda
I also ran:
S:\SQL_Server_2017\MSSQL14.HEDGETOOLS\PYTHON_SERVICES\Scripts>conda update --all
and this updated almost 100 packages. The python in SQL Server 2017 was apparently quite out of date.
I worry that revoscalepy is confused by having two Anaconda pythons on my development machine. How can I solve this problem.
Charles
Charles Brauer