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://docs.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.


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://docs.microsoft.com/en-us/sql/advanced-analytics/r/install-additional-r-packages-on-sql-server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.