3
votes

I am trying to connect to Netezza using python's pyodbc. Here is my code:

import pyodbc
print pyodbc.dataSources()
conn = pyodbc.connect("DRIVER={NetezzaSQL};SERVER=netezza;PORT=<>;DATABASE=SYSTEM;UID=<>;PWD=<>;",ansi=True)

The error that i am getting is:

Error Traceback (most recent call last) in () 1 import pyodbc 2 print pyodbc.dataSources() ----> 3 conn = pyodbc.connect("DRIVER={NetezzaSQL};SERVER=netezza;PORT=5480;DATABASE=SYSTEM;UID=ins_etl_usr_qa;PWD=password;",ansi=True) 4 #cnxn = pyodbc.connect("DSN=MSSQL-PYTHON") 5 #conn = pyodbc.connect("DRIVER={NetezzaSQL};SERVER=server.example.com;DATABASE=mydatabase;UID=myusername;PWD=password", ansi=True)

Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'NetezzaSQL' : file not found (0) (SQLDriverConnect)")

1

1 Answers

0
votes

The error say that it can find NetezzaSQL library so you have to make sure that you have that library installed and accessible.

Accessible in Linux would be having the library installed in the default location for libraries or setting LD_LIBRARY_PATH environment variable to point to the folder where you have the library.