python - Connecting to database using SQLAlchemy -
i'm trying connect database on local machine.
import sqlalchemy engine = sqlalchemy.create_engine('mssql+pyodbc://localhost\\sqlexpress/ncm')
it fails following error:
dbapierror: (pyodbc.error) ('im002', '[im002] [microsoft][odbc driver manager] data source name not found , no default driver specified (0) (sqldriverconnect)')
and outputs warning:
c:\miniconda\envs\bees\lib\site-packages\sqlalchemy\connectors\pyodbc.py:82: sawarning: no driver name specified; expected pyodbc when using dsn-less connections "no driver name specified; "
where should looking diagnose problem?
as shown in this link, of version 1.0.0 need specify driver explicitly hostname connections.
changed in version 1.0.0: hostname-based pyodbc connections require sql server driver name specified explicitly. sqlalchemy cannot choose optimal default here varies based on platform , installed drivers.
Comments
Post a Comment