I'm doing some PoC work with Python integration in SQL Server 2017.
I have got the basic steps working, & have completed this example successfully: https://learn.microsoft.com/en-us/sql/advanced-analytics/tutorials/run-python-using-t-sql
For the PoC I'm trying to complete, I need to us some external python modules (for example tensorflow) that don't seem to come with the standard python libraries that are bundled with SQL Server.
In a standard python IDE, I would just do install with pip or git clone. If I do this on the server that is running SQL Server it completes successfully, but I can't seem to use the external modules from TSQL.
Error message is:
ImportError: No module named 'tensorflow'
Does anyone know if it is possible to do this?
I've tried googling, but not much coming back. I guess as this is such a new feature that there isn't a huge amount of knowledge in the community.
-
This link says it's possible under 'Rich extensibility' blogs.technet.microsoft.com/dataplatforminsider/2017/04/19/…Mark Sinkinson– Mark Sinkinson2017年10月20日 08:12:37 +00:00Commented Oct 20, 2017 at 8:12
-
And this link shows you how to find a list of installed packages: blog.dbi-services.com/… Other than that, I can find nothing else like you.Mark Sinkinson– Mark Sinkinson2017年10月20日 08:13:29 +00:00Commented Oct 20, 2017 at 8:13
1 Answer 1
Just in case someone finds this question when searching the net
I logged an advisory case with MS as I needed an answer on this. They have come back to me with the following method that works:
Open a command prompt (as administrator) and navigate to the python
directory (and inside the scripts directory)
cd c:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\Scripts\Python
pip install <packagename>
Nb: There is a cleaner way to do this with R packages, but this functionality is not there for python yet. I would assume in later versions that a similar process will be available for python: https://learn.microsoft.com/en-us/sql/advanced-analytics/r/install-additional-r-packages-on-sql-server