title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic |
---|---|---|---|---|---|---|---|---|
Step 1 - Configure pyodbc environment |
Step 1 of this getting started guide involves installing Python, the Microsoft ODBC Driver for SQL Server, and pyODBC into your development environment. |
David-Engel |
davidengel |
mikeray |
09/18/2024 |
sql |
connectivity |
how-to |
You need to configure your development environment with the prerequisites in order to develop an application using the pyodbc Python driver for SQL Server.
- Python 3
- If you don't already have Python, install the Python runtime and Python Package Index (PyPI) package manager from python.org.
- Prefer to not use your own environment? Open as a devcontainer using GitHub Codespaces.
This driver requires the host operating system to have the appropriate ODBC driver already installed.
-
Obtain and install the Microsoft ODBC driver for SQL Server on Windows:
-
Verify that you have installed the driver.
-
Obtain and install the Microsoft ODBC driver for SQL Server on Linux:
-
Verify that you have installed the driver.
-
Obtain and install the Microsoft ODBC driver for SQL Server on macOS:
-
Verify that you have installed the driver.
Get the pyodbc
package from PyPI.
-
Open a command prompt in an empty directory.
-
Install the
pyodbc
package.pip install pyodbc
You can use the PyPI command-line tool to verify that your intended packages are installed.
-
Check the list of installed packages with
pip list
.pip list