Setting up Python to use the ODBC Driver


Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in other languages.

Python is included with Mac OS X. There are several modules available for connecting to a SQL database using ODBC.

The first option is to use the commercially-supported mxODBC module from eGenix. mxODBC provides an easy to use, high-performance, reliable and robust Python interface to most popular ODBC compatible databases.

A second option is to use the open source pyodbc module. pyodbc is a standalone library makes it easy to connect to databases using ODBC. As a convenience, Actual Technologies provides an installer that will install a pre-built pyodbc library in the site-packages folder within the /Library/Python folder:

Download pyodbc installer

NOTE: if you build the pyodbc library from the source code, make sure it links with the iODBC libraries instead of the unixODBC libraries that are chosen by default. Actual Technologies drivers (and nearly all other drivers available for Mac OS X) use the iODBC standard.