### Install pyodbc using pip Source: https://github.com/mkleehammer/pyodbc/blob/master/README.md The recommended method for installing pyodbc is using pip. Ensure you have Python and pip installed. ```bash python -m pip install pyodbc ``` -------------------------------- ### Install unixODBC on macOS Source: https://github.com/mkleehammer/pyodbc/blob/master/README.md On macOS, install unixODBC using Homebrew before installing pyodbc if you don't have an ODBC driver manager. ```bash brew install unixodbc python -m pip install pyodbc ``` -------------------------------- ### Build pyodbc Extension In-Place Source: https://github.com/mkleehammer/pyodbc/blob/master/CLAUDE.md Builds the C++ extension for pyodbc in the current directory. This is useful for a fast development loop before installing. ```sh python setup.py build_ext --inplace ``` -------------------------------- ### Run Full pyodbc Test Matrix with Tox Source: https://github.com/mkleehammer/pyodbc/blob/master/CLAUDE.md Executes the complete pyodbc test suite across multiple Python interpreters using tox. Ensure tox is installed via pipx. ```sh tox ``` -------------------------------- ### Build and Test pyodbc In-Place Source: https://github.com/mkleehammer/pyodbc/blob/master/HACKING.md Build the library in-place for rapid development testing. Run pytest from the root directory to use the newly built library. ```bash python setup.py build_ext --inplace pytest test/test_postgresql.py -vxk test_text ``` -------------------------------- ### Build and Test pyodbc with Trace Output Source: https://github.com/mkleehammer/pyodbc/blob/master/HACKING.md Build the library with PYODBC_TRACE enabled and run tests with the -s flag to capture output when segmentation faults occur. ```bash python setup.py build_ext --inplace -D PYODBC_TRACE pytest test/test_postgresql.py -vxk test_text -vs ``` -------------------------------- ### Build pyodbc with Tracing Enabled Source: https://github.com/mkleehammer/pyodbc/blob/master/CLAUDE.md Builds the pyodbc C++ extension with tracing enabled using the PYODBC_TRACE flag. This is helpful for debugging crashes. ```sh python setup.py build_ext --inplace -D PYODBC_TRACE ``` -------------------------------- ### Run pyodbc Tests for a Specific Interpreter with Tox Source: https://github.com/mkleehammer/pyodbc/blob/master/CLAUDE.md Runs the pyodbc test suite for a single specified Python interpreter (e.g., py312) using tox. ```sh tox -e py312 ``` -------------------------------- ### Run Specific pyodbc Tests Source: https://github.com/mkleehammer/pyodbc/blob/master/CLAUDE.md Executes a specific test case for pyodbc using pytest. The `-vxk` flags enable verbose output, show captured stdout, and filter tests by name substring. ```sh pytest tests/sqlite_test.py -vxk test_text ``` -------------------------------- ### Debug pyodbc Crashes with Tracing Source: https://github.com/mkleehammer/pyodbc/blob/master/CLAUDE.md Runs pyodbc tests with tracing enabled and pytest's `-s` flag to capture output during segfaults. This aids in debugging crashes. ```sh pytest tests/sqlite_test.py -vxs -k test_text ``` -------------------------------- ### Pass Pytest Arguments via Tox Source: https://github.com/mkleehammer/pyodbc/blob/master/CLAUDE.md Executes pyodbc tests using tox for a specific interpreter while passing additional arguments to pytest. The `--` separates tox arguments from pytest arguments. ```sh tox -e py312 -- -rA ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.