SQL Server 2017 Python package installation failed RRS feed

  • Question

  • Hi community,

    I just installed the in-database Python with SQL Server 2017. I need to install a Python package so that I followed the instruction listed on ( 

    Microsoft recommended to install Python sqlmlutils package first.

    So, I opened my cmd in Administrator mode. Then I entered in the Scripts folder using the following commands:

    cd c:\
    cd ".\Program Files\Microsoft SQL Server\MSSQL14.DSPOC\PYTHON_SERVICES\Scripts"

    Then, I pip installed pymssql and sqlmlutils using the following commands:

    pip install "pymssql<3.0"
    pip install --upgrade --upgrade-strategy only-if-needed c:\temp\ 

    Then, I kept to follow Microsoft's instruction. Then, I went to the Microsoft Python's folder using the following commands: 

    cd c:\
    cd ".\Program Files\Microsoft SQL Server\MSSQL14.DSPOC\PYTHON_SERVICES\"

    Then, I typed python.exe. It pops up the Python concole (Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul  5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32).

    import sqlmlutils
    connection = sqlmlutils.ConnectionInfo(server=".\\Instance", database="database1")

    After I executed the above Python scripts. I saw the following error messages:

    How can I install a Python library in SQL Server in-database Python? Another question is I want to install Tensorflow in SQL Server's in-database Python. Do you guys recommend that?


    Saturday, December 21, 2019 8:36 PM

All replies

  • Sorry for the late reply, but Python package management using sqlmlutils package is only supported in SQL Server 2019. This mentioned on the following page:

    You have two options to get things working with SQL Server 2017:

    1). Download and install the python package directly on the server using python's 'pip' utility.

    2). Create a Python external library using the 'CREATE EXTERNAL LIBRARY' command and install the package

          via a SQL script.  For an example of how to do this look here:


    Thursday, January 2, 2020 8:28 PM
  • It is perfectly fine to install 'TensorFlow' under the SQL Server's in-database python.
    Thursday, January 2, 2020 8:30 PM