Skip to content

Commit a0f8640

Browse files
Merge pull request #35668 from dlevy-msft-sql/dlevy-10-28-2025-mac-update
Add extra instructions for mac users
2 parents 2d29b1a + 12bbe50 commit a0f8640

4 files changed

Lines changed: 101 additions & 47 deletions

docs/connect/python/mssql-python/python-sql-driver-mssql-python-connect-jupyter-notebook.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: This quickstart describes connect to your SQL database from a Jupyt
44
author: dlevy-msft-sql
55
ms.author: dlevy
66
ms.reviewer: vanto, randolphwest
7-
ms.date: 10/06/2025
7+
ms.date: 10/30/2025
88
ms.service: sql
99
ms.subservice: connectivity
1010
ms.topic: quickstart-sdk
@@ -36,6 +36,10 @@ The `mssql-python` driver doesn't require any external dependencies on Windows m
3636

3737
- [Jupyter Extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter)
3838

39+
- [(Optional) Azure Repos](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-repos)
40+
41+
- [(Optional) Azure Command-Line Interface (CLI)](/cli/azure/install-azure-cli)
42+
3943
- If you don't already have `uv`, install `uv` by following the instructions from [https://docs.astral.sh/uv/getting-started/installation/](https://docs.astral.sh/uv/getting-started/installation/).
4044

4145
- A database on SQL Server, Azure SQL Database, or SQL database in Fabric with the [!INCLUDE [sssampledbobject-md](../../../includes/sssampledbobject-md.md)] sample schema and a valid connection string.
@@ -44,37 +48,37 @@ The `mssql-python` driver doesn't require any external dependencies on Windows m
4448

4549
### [Alpine](#tab/alpine-linux)
4650

47-
```bash
51+
```console
4852
apk add libtool krb5-libs krb5-dev
4953
```
5054

5155
### [Debian/Ubuntu](#tab/debianUbuntu-linux)
5256

53-
```bash
57+
```console
5458
apt-get install -y libltdl7 libkrb5-3 libgssapi-krb5-2
5559
```
5660

5761
### [RHEL](#tab/RHEL-linux)
5862

59-
```bash
63+
```console
6064
dnf install -y libtool-ltdl krb5-libs
6165
```
6266

6367
### [SUSE](#tab/SUSE-linux)
6468

65-
```bash
69+
```console
6670
zypper install -y libltdl7 libkrb5-3 libgssapi-krb5-2
6771
```
6872

6973
### [openSUSE](#tab/openSUSE-linux)
7074

71-
```bash
75+
```console
7276
zypper install -y libltdl7
7377
```
7478

7579
### [macOS](#tab/mac)
7680

77-
```bash
81+
```console
7882
brew install openssl
7983
```
8084

@@ -119,7 +123,7 @@ This quickstart requires the *[!INCLUDE [sssampledbnormal-md](../../../includes/
119123

120124
1. Create a new [project](https://docs.astral.sh/uv/guides/projects/#project-structure) with `uv`.
121125

122-
```bash
126+
```console
123127
uv init jupyter-notebook-qs
124128
cd jupyter-notebook-qs
125129
```
@@ -128,7 +132,7 @@ This quickstart requires the *[!INCLUDE [sssampledbnormal-md](../../../includes/
128132

129133
In the same directory, install the `mssql-python`, `python-dotenv`, `rich`, `pandas`, and `matplotlib` packages. Then add `ipykernel` and `uv` as dev dependencies. VS Code requires `ipykernel` and `uv` are added to be able to interact with `uv` from within your notebook cells using commands like `!uv add mssql_python`.
130134

131-
```bash
135+
```console
132136
uv add mssql_python dotenv rich pandas matplotlib
133137
uv add --dev ipykernel
134138
uv add --dev uv
@@ -138,7 +142,7 @@ uv add --dev uv
138142

139143
In the same directory, run the following command.
140144

141-
```bash
145+
```console
142146
code .
143147
```
144148

@@ -284,6 +288,9 @@ code .
284288
Console().print(table)
285289
```
286290

291+
> [!TIP]
292+
> To use Microsoft Entra Authentication in macOS, you must be signed in via either the [Azure Repos](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-repos) extension in Visual Studio Code, or by running `az login` via the [Azure Command-Line Interface (CLI)](/cli/azure/install-azure-cli).
293+
287294
1. Use the **Run All** button at the top of the notebook to run the notebook.
288295

289296
1. Select the **jupyter-notebook-qs** kernel when prompted.

docs/connect/python/mssql-python/python-sql-driver-mssql-python-quickstart.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: This quickstart describes installing Python, and mssql-python then
44
author: dlevy-msft-sql
55
ms.author: dlevy
66
ms.reviewer: vanto, randolphwest
7-
ms.date: 10/06/2025
7+
ms.date: 10/30/2025
88
ms.service: sql
99
ms.subservice: connectivity
1010
ms.topic: quickstart-sdk
@@ -16,7 +16,9 @@ ms.custom:
1616

1717
In this quickstart, you connect a Python script to a database that you created and loaded with sample data. You use the `mssql-python` driver for Python to connect to your database and perform basic operations, like reading and writing data.
1818

19-
[mssql-python documentation](https://github.com/microsoft/mssql-python/wiki) | [mssql-python source code](https://github.com/microsoft/mssql-python/wiki) | [Package (PyPi)](https://pypi.org/project/mssql-python/)
19+
The `mssql-python` driver doesn't require any external dependencies on Windows machines. The driver installs everything that it needs with a single `pip` install, allowing you to use the latest version of the driver for new scripts without breaking other scripts that you don't have time to upgrade and test.
20+
21+
[mssql-python documentation](https://github.com/microsoft/mssql-python/wiki) | [mssql-python source code](https://github.com/microsoft/mssql-python/wiki) | [Package (PyPi)](https://pypi.org/project/mssql-python/) | [Visual Studio Code](https://code.visualstudio.com/download)
2022

2123
## Prerequisites
2224

@@ -28,6 +30,8 @@ In this quickstart, you connect a Python script to a database that you created a
2830

2931
[:::image type="icon" source="https://github.com/codespaces/badge.svg":::](https://codespaces.new/github/codespaces-blank?quickstart=1)
3032

33+
- [(Optional) Azure Command-Line Interface (CLI)](/cli/azure/install-azure-cli)
34+
3135
- A database on SQL Server, Azure SQL Database, or SQL database in Fabric with the [!INCLUDE [sssampledbobject-md](../../../includes/sssampledbobject-md.md)] sample schema and a valid connection string.
3236

3337
## Setup
@@ -47,48 +51,48 @@ Get the [`mssql-python` package](https://pypi.org/project/mssql-python/) from Py
4751

4852
### [Windows](#tab/windows)
4953

50-
```bash
54+
```console
5155
pip install mssql-python
5256
```
5357

5458
### [Alpine](#tab/alpine-linux)
5559

56-
```bash
60+
```console
5761
apk add libtool krb5-libs krb5-dev
5862
pip install mssql-python
5963
```
6064

6165
### [Debian/Ubuntu](#tab/debianUbuntu-linux)
6266

63-
```bash
67+
```console
6468
apt-get install -y libltdl7 libkrb5-3 libgssapi-krb5-2
6569
pip install mssql-python
6670
```
6771

6872
### [RHEL](#tab/RHEL-linux)
6973

70-
```bash
74+
```console
7175
dnf install -y libtool-ltdl krb5-libs
7276
pip install mssql-python
7377
```
7478

7579
### [SUSE](#tab/SUSE-linux)
7680

77-
```bash
81+
```console
7882
zypper install -y libltdl7 libkrb5-3 libgssapi-krb5-2
7983
pip install mssql-python
8084
```
8185

8286
### [openSUSE](#tab/openSUSE-linux)
8387

84-
```bash
88+
```console
8589
zypper install -y libltdl7
8690
pip install mssql-python
8791
```
8892

8993
### [macOS](#tab/mac)
9094

91-
```bash
95+
```console
9296
brew install openssl
9397
pip install mssql-python
9498
```
@@ -101,7 +105,7 @@ Get the [`python-dotenv`](https://pypi.org/project/python-dotenv/) from PyPI.
101105

102106
1. In the same directory, install the `python-dotenv` package.
103107

104-
```bash
108+
```console
105109
pip install python-dotenv
106110
```
107111

@@ -111,7 +115,7 @@ You can use the PyPI command-line tool to verify that your intended packages are
111115

112116
1. Check the list of installed packages with `pip list`.
113117

114-
```bash
118+
```console
115119
pip list
116120
```
117121

@@ -224,9 +228,12 @@ Use a SQL query string to execute a query and parse the results.
224228

225229
1. **Save** the `app.py` file.
226230

231+
> [!TIP]
232+
> To use Microsoft Entra Authentication in macOS, you need to be logged in by running `az login` via the [Azure Command-Line Interface (CLI)](/cli/azure/install-azure-cli).
233+
227234
1. Open a terminal and test the application.
228235

229-
```bash
236+
```console
230237
python app.py
231238
```
232239

@@ -308,7 +315,7 @@ Execute an [INSERT](../../../t-sql/statements/insert-transact-sql.md) statement
308315

309316
1. **Save** the `app.py` file and test the application again.
310317

311-
```bash
318+
```console
312319
python app.py
313320
```
314321

docs/connect/python/mssql-python/python-sql-driver-mssql-python-rapid-prototyping-quickstart.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: This quickstart describes creating prototypes reports quickly using
44
author: dlevy-msft-sql
55
ms.author: dlevy
66
ms.reviewer: vanto, randolphwest
7-
ms.date: 10/06/2025
7+
ms.date: 10/30/2025
88
ms.service: sql
99
ms.subservice: connectivity
1010
ms.topic: quickstart-sdk
@@ -18,7 +18,7 @@ In this quickstart, you use [`Streamlit`](https://streamlit.io/) to quickly crea
1818

1919
The `mssql-python` driver doesn't require any external dependencies on Windows machines. The driver installs everything that it needs with a single `pip` install, allowing you to use the latest version of the driver for new scripts without breaking other scripts that you don't have time to upgrade and test.
2020

21-
[mssql-python documentation](https://github.com/microsoft/mssql-python/wiki) | [mssql-python source code](https://github.com/microsoft/mssql-python/wiki) | [Package (PyPi)](https://pypi.org/project/mssql-python/) | [UV](https://docs.astral.sh/uv/)
21+
[mssql-python documentation](https://github.com/microsoft/mssql-python/wiki) | [mssql-python source code](https://github.com/microsoft/mssql-python/wiki) | [Package (PyPi)](https://pypi.org/project/mssql-python/) | [uv](https://docs.astral.sh/uv/)
2222

2323
## Prerequisites
2424

@@ -30,43 +30,51 @@ The `mssql-python` driver doesn't require any external dependencies on Windows m
3030

3131
[:::image type="icon" source="https://github.com/codespaces/badge.svg":::](https://codespaces.new/github/codespaces-blank?quickstart=1)
3232

33+
- [Visual Studio Code](https://code.visualstudio.com/download) with the following extensions:
34+
35+
- [Python extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
36+
37+
- [(Optional) Azure Repos](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-repos)
38+
39+
- [(Optional) Azure Command-Line Interface (CLI)](/cli/azure/install-azure-cli)
40+
3341
- If you don't already have `uv`, install `uv` by following the instructions from [https://docs.astral.sh/uv/getting-started/installation/](https://docs.astral.sh/uv/getting-started/installation/).
3442
- A database on SQL Server, Azure SQL Database, or SQL database in Fabric with the [!INCLUDE [sssampledbobject-md](../../../includes/sssampledbobject-md.md)] sample schema and a valid connection string.
3543
- Install one-time operating system specific prerequisites.
3644

3745
### [Alpine](#tab/alpine-linux)
3846

39-
```bash
47+
```console
4048
apk add libtool krb5-libs krb5-dev
4149
```
4250

4351
### [Debian/Ubuntu](#tab/debianUbuntu-linux)
4452

45-
```bash
53+
```console
4654
apt-get install -y libltdl7 libkrb5-3 libgssapi-krb5-2
4755
```
4856

4957
### [RHEL](#tab/RHEL-linux)
5058

51-
```bash
59+
```console
5260
dnf install -y libtool-ltdl krb5-libs
5361
```
5462

5563
### [SUSE](#tab/SUSE-linux)
5664

57-
```bash
65+
```console
5866
zypper install -y libltdl7 libkrb5-3 libgssapi-krb5-2
5967
```
6068

6169
### [openSUSE](#tab/openSUSE-linux)
6270

63-
```bash
71+
```console
6472
zypper install -y libltdl7
6573
```
6674

6775
### [macOS](#tab/mac)
6876

69-
```bash
77+
```console
7078
brew install openssl
7179
```
7280

@@ -98,6 +106,7 @@ This quickstart requires the *[!INCLUDE [sssampledbnormal-md](../../../includes/
98106

99107
- [Create a new project](#create-a-new-project)
100108
- [Add dependencies](#add-dependencies)
109+
- [Launch Visual Studio Code](#launch-visual-studio-code)
101110
- [Update pyproject.toml](#update-pyprojecttoml)
102111
- [Update main.py](#update-mainpy)
103112
- [Save the connection string](#save-the-connection-string)
@@ -109,7 +118,7 @@ This quickstart requires the *[!INCLUDE [sssampledbnormal-md](../../../includes/
109118

110119
1. Create a new [project](https://docs.astral.sh/uv/guides/projects/#project-structure) with `uv`.
111120

112-
```bash
121+
```console
113122
uv init rapid-prototyping-qs
114123
cd rapid-prototyping-qs
115124
```
@@ -118,10 +127,18 @@ This quickstart requires the *[!INCLUDE [sssampledbnormal-md](../../../includes/
118127

119128
In the same directory, install the `mssql-python`, `streamlit`, and `python-dotenv` packages.
120129

121-
```bash
130+
```console
122131
uv add mssql-python python-dotenv streamlit
123132
```
124133

134+
### Launch Visual Studio Code
135+
136+
In the same directory, run the following command.
137+
138+
```console
139+
code .
140+
```
141+
125142
### Update pyproject.toml
126143

127144
1. The [pyproject.toml](https://docs.astral.sh/uv/concepts/projects/layout/#the-pyprojecttoml) contains the metadata for your project. Open the file in your favorite editor.
@@ -273,9 +290,12 @@ uv add mssql-python python-dotenv streamlit
273290
274291
### Use uv run to execute the script
275292

293+
> [!TIP]
294+
> To use Microsoft Entra Authentication in macOS, you need to be logged in via either the [Azure Repos](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-repos) extension in Visual Studio Code or by running `az login` via the [Azure Command-Line Interface (CLI)](/cli/azure/install-azure-cli).
295+
276296
1. In the terminal window from before, or a new terminal window open to the same directory, run the following command.
277297

278-
```bash
298+
```console
279299
uv run streamlit run main.py
280300
```
281301

0 commit comments

Comments
 (0)