Install pyodbc via pip
masterThe simplest way to install pyodbc is using pip. Precompiled binary wheels are available for most Windows, macOS, and Linux platforms.
python -m pip install pyodbcrepository·master·Indexed 25 days ago
https://github.com/mkleehammer/pyodbcAn open source Python module that implements the Python DB API 2.0 specification to simplify access to ODBC databases.
The simplest way to install pyodbc is using pip. Precompiled binary wheels are available for most Windows, macOS, and Linux platforms.
python -m pip install pyodbcFor fast development turnaround without using tox, you can build the library in-place and run pytest manually. Building with the --inplace flag ensures the library is built into the root directory, making it available in the path for your tests.
To build the extension in-place:
python setup.py build_ext --inplaceTo run a specific test (e.g., test_text in test_postgresql.py):
pytest test/test_postgresql.py -vxk test_textpython setup.py build_ext --inplace
pytest test/test_postgresql.py -vxk test_textBefore installing pyodbc on macOS, you must ensure an ODBC driver manager is installed. It is recommended to use unixODBC via Homebrew.
brew install unixodbc
python -m pip install pyodbcOn Windows, the ODBC driver manager is built-in, so you can install pyodbc directly using pip.
python -m pip install pyodbcIf a segmentation fault occurs during testing, pytest may suppress the output. To see the output and debug the crash, enable PYODBC_TRACE during the build and add the -s flag to your pytest command to prevent output buffering.
Use the following commands to debug:
python setup.py build_ext --inplace -D PYODBC_TRACE
pytest test/test_postgresql.py -vxk test_text -vspython setup.py build_ext --inplace -D PYODBC_TRACE
pytest test/test_postgresql.py -vxk test_text -vs