Skip to content

Commit ef9fde0

Browse files
romanlutzCopilot
andauthored
DOC: cross-OS troubleshooting + per-OS ODBC install steps (#1932)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 155d9af commit ef9fde0

2 files changed

Lines changed: 57 additions & 5 deletions

File tree

doc/getting_started/troubleshooting/azure_sql_db.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,47 @@ ALTER ROLE db_datawriter ADD MEMBER [user@domain.com];
108108

109109
## 6. Configure Local Environment
110110

111-
Connecting PyRIT to an Azure SQL Server database requires ODBC, PyODBC and Microsoft's [ODBC Driver for SQL Server](https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-ver16) to be installed in your local environment. Consult PyODBC's [documentation](https://github.com/mkleehammer/pyodbc/wiki) for detailed instruction on.
111+
Connecting PyRIT to an Azure SQL Server database requires the **Microsoft ODBC Driver 18 for SQL Server**, which on macOS and Linux depends on **unixODBC**. The `pyodbc` Python package is already installed as a PyRIT dependency.
112+
113+
Install the driver for your OS:
114+
115+
::::{tab-set}
116+
117+
:::{tab-item} Windows
118+
Download and install the [Microsoft ODBC Driver 18 for SQL Server](https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server) MSI from Microsoft.
119+
:::
120+
121+
:::{tab-item} macOS
122+
Install via [Homebrew](https://brew.sh):
123+
124+
```bash
125+
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
126+
brew install msodbcsql18 mssql-tools18
127+
```
128+
:::
129+
130+
:::{tab-item} Linux (Ubuntu / Debian)
131+
```bash
132+
# Install unixODBC
133+
sudo apt-get update
134+
sudo apt-get install -y unixodbc unixodbc-dev
135+
136+
# Add the Microsoft package repository
137+
curl -sSL -O https://packages.microsoft.com/config/ubuntu/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)/packages-microsoft-prod.deb
138+
sudo dpkg -i packages-microsoft-prod.deb
139+
rm packages-microsoft-prod.deb
140+
141+
# Install the driver
142+
sudo apt-get update
143+
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
144+
```
145+
146+
For other Linux distributions (RHEL, SUSE, Alpine), see [Microsoft's installation guide](https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server).
147+
:::
148+
149+
::::
150+
151+
See [PyODBC's documentation](https://github.com/mkleehammer/pyodbc/wiki) for further details.
112152

113153
## 7. Testing
114154

doc/getting_started/troubleshooting/local_dev.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,34 @@ Common issues when setting up PyRIT for local development.
66

77
### uv command not found
88

9-
Make sure uv is in your PATH. Restart PowerShell after installation.
9+
Make sure uv is in your `PATH`. Restart your terminal (PowerShell, bash, zsh, etc.) after installing uv so the updated `PATH` is picked up.
1010

1111
### Import errors
1212

1313
Ensure you're using `uv run python` or have activated the virtual environment:
1414

15+
::::{tab-set}
16+
17+
:::{tab-item} PowerShell (Windows)
1518
```powershell
1619
.\.venv\Scripts\Activate.ps1
1720
```
21+
:::
22+
23+
:::{tab-item} Bash (macOS / Linux)
24+
```bash
25+
source .venv/bin/activate
26+
```
27+
:::
28+
29+
::::
1830

1931
### Dependency conflicts
2032

21-
Try regenerating the lock file:
33+
Try regenerating the lock file (`rm` works in PowerShell as an alias for `Remove-Item`, so the same commands work everywhere):
2234

23-
```powershell
24-
Remove-Item uv.lock
35+
```bash
36+
rm uv.lock
2537
uv sync
2638
```
2739

0 commit comments

Comments
 (0)