pyodbc newbie question, getting error: "('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnect)')"

1,220 views
Skip to first unread message

Brian Merchant

unread,
Dec 11, 2015, 3:34:31 PM12/11/15
to pyodbc
Hi all,

I am having some growing pains, so I hope you can help! I am using Continuum's IOPro version of pyodbc). I have a simple script set up as follows:

import iopro.pyodbc as pyodbc
import numpy as np

testdb_path = "/home/brian/PythonScripts/test.db"

connection_string = "DSN=odbcsqlite;DATABASE={}".format(testdb_path)
connection = pyodbc.connect(connection_string)

cursor = connection.cursor()


When running this script, I get the following error:

connection = pyodbc.connect(connection_string)
iopro.pyodbc.Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnect)')

I think the issue is because of some confused installation on my part of sqlite odbc drivers. For instance, I installed libsqliteodbc (http://packages.ubuntu.com/precise/libs/libsqliteodbc) (I am Ubuntu 15.x), and I seem to have some sensical entries in odbc.ini, but...things are clearly not working, yet.

How would you go about setting up sqlite to work with pyodbc?

Kind regards,
Brian

Brian Merchant

unread,
Dec 11, 2015, 10:51:16 PM12/11/15
to pyodbc
Reply all
Reply to author
Forward
0 new messages