Skip to content

Installation

Sumit Sarabhai edited this page Feb 14, 2025 · 16 revisions

Pre-Requisites

Windows

Install Python

Minimum supported version required for Python is version 3.13.

Important: Check the options as seen below and click on Install Now

image

Post installation, Disable path length limit and then close.

  • Verify the installation by running python --version on command prompt. It should show the current version.

Common Troubleshooting

  • If Windows Store opens up the Python 3.13 page, then click on Get button.
  • If you encounter the python is not recognized error, please refer to online resources for instructions on how to manually add Python to your PATH.

Package Installation Steps

Install using pip

Steps (1) and (2) are optional for Windows and can be skipped.

  1. Create a virtual environment Open the command prompt in your folder and run below (replace python3 with python in case of error):
python3 -m venv myvenv
  1. Activate the virtual environment For Windows:
myvenv\Scripts\activate

This should show a prefix (myvenv) in the command prompt.

  1. Set Connection String as ENV variable (replace with your server details) The following example demonstrates connection string for Azure SQL Database.
set DB_CONNECTION_STRING=SERVER=tcp:sample.database.windows.net,1433;DATABASE=<your_databasename>;UID=<your_userid>;PWD=<your_password>;Encrypt=yes;

Using EntraID Authentication

In the server string, use Authentication=ActiveDirectoryPassword; to use EntraID UID and Password (applicable for all platforms).

For Windows only, use Authentication=ActiveDirectoryInteractive; to use interactive MFA.

  1. Run pip install to install the package in your environment
pip install mssql-python --upgrade

Use --upgrade to keep it updated to the latest version.

  1. Run the main\sample scripts for test
python main.py
Clone this wiki locally