0

Where can I check at first to resolve the following error message? I would like to connect to SQL Server on Docker, from a Mac using Jupyter notebook.

code

import sqlalchemy
import pyodbc
import sqlalchemy as sa

engine = sqlalchemy.create_engine("mssql+pyodbc://SA:<12345qwert>@MSSQL_DSN")
connection = engine.connect()

error message

InterfaceError: (pyodbc.InterfaceError) ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnect)') (Background on this error at: http://sqlalche.me/e/rvf5)

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
Yoshito0504
  • 1
  • 1
  • 1
  • Have a look here: https://stackoverflow.com/questions/16280304/pyodbc-data-source-name-not-found-and-no-default-driver-specified – Ilja Everilä Sep 21 '18 at 09:50
  • I would start with `odbcinst -j` and `isql MSSQL_DSN sa "<12345qwert>"` – Gord Thompson Sep 21 '18 at 14:05
  • Thank you everyone! I resolved this problem by execute below command `$ cp /usr/local/etc/odbc.ini /etc/odbc.ini` `$ cp /usr/local/etc/odbcinst.ini /etc/odbcinst.ini` – Yoshito0504 Sep 23 '18 at 04:15

0 Answers0