Skip to content

Commit 0bf50ec

Browse files
committed
Fix python clustering tutorial and associated docs
1 parent 73ffc80 commit 0bf50ec

5 files changed

Lines changed: 28 additions & 6 deletions

File tree

docs/azure-data-studio/tutorial-backup-restore-sql-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ After you select **Backup**, the **Backup database** dialog box disappears and t
6262

6363
1. Select **Backup file** in the **Restore from** box.
6464

65-
1. Select the ellipses (...) in the **Backup file path** box, and select the latest backup file for *TutorialDB*.
65+
1. Select the ellipses (...) in the **Backup file path** box, and select the latest backup file for *TutorialDB*. Ensure the SQL Server service has READ permissions on the backup file.
6666

6767
1. Enter **TutorialDB_Restored** in the **Target database** box in the **Destination** section to restore the backup file to a new database. Then select **Restore**.
6868

docs/machine-learning/install/sql-machine-learning-services-windows-install-sql-2022.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,15 @@ Beginning with [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)], runtimes f
149149

150150
```cmd
151151
cd "C:\Program Files\Python310\"
152-
python -m pip install dill numpy==1.22.0 pandas patsy python-dateutil
153-
python -m pip install https://aka.ms/sqlml/python3.10/windows/revoscalepy-10.0.1-py3-none-any.whl
152+
python -m pip install -t "C:\Program Files\Python310\Lib\site-packages" dill numpy==1.22.0 pandas patsy python-dateutil
153+
python -m pip install -t "C:\Program Files\Python310\Lib\site-packages" https://aka.ms/sqlml/python3.10/windows/revoscalepy-10.0.1-py3-none-any.whl
154+
```
155+
156+
Run the following **icacls** commands from a new elevated command prompt to grant **READ & EXECUTE** access to the installed libraries to **SQL Server Launchpad Service** and SID **S-1-15-2-1 (ALL_APPLICATION_PACKAGES)**.
157+
158+
```cmd
159+
icacls "C:\Program Files\Python310\Lib\site-packages" /grant "NT Service\MSSQLLAUNCHPAD":(OI)(CI)RX /T
160+
icacls "C:\Program Files\Python310\Lib\site-packages" /grant *S-1-15-2-1:(OI)(CI)RX /T
154161
```
155162
156163
#### Configure Python runtime with SQL Server

docs/machine-learning/tutorials/python-clustering-model-deploy.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ Run the following T-SQL script to create the stored procedure. The procedure rec
5656
USE [tpcxbb_1gb]
5757
GO
5858

59+
DROP procedure IF EXISTS [dbo].[py_generate_customer_return_clusters];
60+
GO
61+
5962
CREATE procedure [dbo].[py_generate_customer_return_clusters]
6063
AS
6164

docs/machine-learning/tutorials/python-clustering-model-prepare-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ column_info = {
118118
Results from the query are returned to Python using the Pandas **read_sql** function. As part of the process, you'll use the column information you defined in the previous script.
119119

120120
```python
121-
customer_data = pandas.read_sql(input_query, conn_str)
121+
customer_data = pd.read_sql(input_query, conn_str)
122122
```
123123

124124
Now display the beginning of the data frame to verify it looks correct.

docs/machine-learning/tutorials/python-clustering-model.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ In [part four](python-clustering-model-deploy.md), learn how to create a stored
4545

4646
## Prerequisites
4747

48-
::: moniker range=">=sql-server-ver15||>=sql-server-linux-ver15"
48+
::: moniker range=">=sql-server-ver16||>=sql-server-linux-ver16"
49+
- [SQL Server Machine Learning Services](../sql-server-machine-learning-services.md) with the Python language option - Follow the installation instructions in the [Windows installation guide](../install/sql-machine-learning-services-windows-install-sql-2022.md) or the [Linux installation guide](../../linux/sql-server-linux-setup-machine-learning-sql-2022.md?toc=%252fsql%252fmachine-learning%252ftoc.json&view=sql-server-linux-ver16&preserve-view=true).
50+
::: moniker-end
51+
::: moniker range="=sql-server-ver15||=sql-server-linux-ver15"
4952
- [SQL Server Machine Learning Services](../sql-server-machine-learning-services.md) with the Python language option - Follow the installation instructions in the [Windows installation guide](../install/sql-machine-learning-services-windows-install.md) or the [Linux installation guide](../../linux/sql-server-linux-setup-machine-learning.md?toc=%252fsql%252fmachine-learning%252ftoc.json&view=sql-server-linux-ver15&preserve-view=true). You can also [enable Machine Learning Services on SQL Server Big Data Clusters](../../big-data-cluster/machine-learning-services.md).
5053
::: moniker-end
5154
::: moniker range="=sql-server-2017"
@@ -61,7 +64,7 @@ In [part four](python-clustering-model-deploy.md), learn how to create a stored
6164

6265
- Additional Python packages - The examples in this tutorial series use Python packages that you may or may not have installed.
6366

64-
Open a **Command Prompt** and change to the installation path for the version of Python you use in Azure Data Studio. For example, `cd %LocalAppData%\Programs\Python\Python37-32`. Then run the following commands to install any of these packages that aren't already installed.
67+
Open an **Admin Command Prompt** and change to the installation path for the version of Python you use in Azure Data Studio. For example, `cd %LocalAppData%\Programs\Python\Python37-32`. Then run the following commands to install any of these packages that aren't already installed. Ensure these packages are installed in the correct python install location, you can use the option `-t` to specify the destination directory.
6568

6669
```console
6770
pip install matplotlib
@@ -71,6 +74,15 @@ In [part four](python-clustering-model-deploy.md), learn how to create a stored
7174
pip install scikit-learn
7275
```
7376

77+
::: moniker range=">=sql-server-ver15"
78+
Run the following **icacls** commands to grant **READ & EXECUTE** access to the installed libraries to **SQL Server Launchpad Service** and SID **S-1-15-2-1 (ALL_APPLICATION_PACKAGES)**.
79+
80+
```cmd
81+
icacls "C:\Program Files\Python310\Lib\site-packages" /grant "NT Service\MSSQLLAUNCHPAD":(OI)(CI)RX /T
82+
icacls "C:\Program Files\Python310\Lib\site-packages" /grant *S-1-15-2-1:(OI)(CI)RX /T
83+
```
84+
::: moniker-end
85+
7486
## Restore the sample database
7587

7688
The sample dataset used in this tutorial has been saved to a **.bak** database backup file for you to download and use. This dataset is derived from the [tpcx-bb](http://www.tpc.org/tpcx-bb/default5.asp) dataset provided by the [Transaction Processing Performance Council (TPC)](http://www.tpc.org/).

0 commit comments

Comments
 (0)