Run multiple python version on SQL Server (2017)

415 Views Asked by At

Is it possible to run multiple Python versions on SQL Sever 2017?

It is possible to do on Windows (2 Python folders, 2 shortcuts, 2 environment paths). But how to launch another Python version if I run Python via sp_execute_external_script in SQL Management Studio 18?

In SQL server\Launchpad\properties\Binary path there is the parameter -launcher Pythonlauncher. Probably, by changing this, it is possible to run another Python version.

Other guess: to create multiple Python folders C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\PYTHON_SERVICES. But how to switch them?

Other guess: in C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\pythonlauncher.config - in PYTHONHOME and ENV_ExaMpiCommDllPath parameters substitute the folder C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\ with the folder with new Python version.

1

There are 1 best solutions below

0
On

The answer is:

  1. Copy in

C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\

folder as many Python versions as you want (Python version = folder with Python like PYTHON_SERVICES)

  1. Stop Launchpad

  2. Change in

C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\pythonlauncher.config

file: in PYTHONHOME and ENV_ExaMpiCommDllPath parameters substitute the folder

C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\

with the folder with new Python version.

  1. Start Launchpad