简体   繁体   中英

Using pandas 0.25.1 in MS SQL Server 2019

I am trying to update to pandas==0.25.1 on my MS SQL Server 2019.

import sqlmlutils

connection = sqlmlutils.ConnectionInfo(server=SERVER_NAME, database=DATABASE_NAM)
sqlmlutils.SQLPackageManager(connection).install('pandas', True, '0.25.1')

which successfully installs and updates pandas:

>>> Installing dependencies...
>>> Done with dependencies, installing main package...
>>> Installing pandas version: 0.25.1

However, when I execute a python script with sp_execute_external_script command

EXEC sp_execute_external_script @language = N'Python',
    @script = N'
    import pandas as pd
    print(pd.__version__)
    '

I get the following output:

>>> STDOUT message(s) from external script:
>>> 0.23.4

ie, that the instance is using pandas==0.23.4 rather than pandas==0.25.1 .

Why is this? Is there a method for using pandas==0.25.1 within MS SQL Server 2019?

cmd (as administrator) (also stopped launchpad service in sql configuration manager, maybe not needed?)

navigate to C:\Program Files\Microsoft SQL Server\xyz\PYTHON_SERVICES\condabin>

and type: conda install pandas=0.25.1

after package download and validation you'll be asked [y\n] confirmation for installation

if you get an ssl error, you'll need to install openssl for windows.

I had the same issue. I try using sqlmlutils, pip, conda for install online, offline but pandas still version 0.23.4, each installs always success. One thing, you can install the new package, but you can not upgrade it. In my case is seaborn. I had installed it with version 0.9, and trying to upgrade to 0.10, but can not upgrade. It seems SQL server ML services don't allow for upgrade packages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM