Skip to content Skip to sidebar Skip to footer

Importing Python Libraries To Sql Server

I'm trying to 'import datefinder' in my SQL Server Python script, but for some reason it doesn't work. Other libraries (for example Pandas) seem to work just fine. I've tried follo

Solution 1:

https://thomaslarock.com/2018/05/adding-python-packages-to-sql-server-2017/

Best explanation I could ever find !

EXEC sp_execute_external_script
  @language=N'Python',
  @script=N'import sys; print("\n".join(sys.path))'

Lets you retrieve the path to the python environment used by SQL Server:

C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER2017\PYTHON_SERVICES\lib\site-packages\setuptools-27.2.0-py3.5.egg

Open a command line, navigate down to your PYTHON_SERVICES/Scripts directory. From there, call pip install datefinder You will need to have the rights to do this.

Post a Comment for "Importing Python Libraries To Sql Server"