1) I Downloaded the Netsuite ODBC Driver zip file from https://6765252-sb1.app.netsuite.com/app/external/odbc/suiteAnalyticsConnectDownload.nl for linux 64 bit.
2) I use Docker Container and here is my DockerFile
FROM python:3.7
# here goes the source code
ADD projects/netsuite /netsuite
ADD projects/utils /utils
ENV PYTHONPATH="$PYTHONPATH:/projects"
# creating directory
RUN mkdir /opt/netsuite
RUN mkdir /opt/netsuite/odbcclient/
# copying the ODBC zip file to this directory
COPY projects/netsuite/NetSuiteODBCDrivers_Linux64bit.zip /opt/netsuite/odbcclient/
COPY projects/netsuite/Certificates.zip /opt/netsuite/odbcclient/
# install system dependencies
RUN apt-get update \
&& apt-get -y install gcc \
&& apt-get -y install g++ \
&& apt-get -y install unixodbc unixodbc-dev \
&& apt-get clean
# unzip the odbc file
RUN unzip /opt/netsuite/odbcclient/NetSuiteODBCDrivers_Linux64bit.zip \
&& unzip /opt/netsuite/odbcclient/Certificates.zip
# moving the odbcinst and odbc64.ini files to /etc/ location
ADD projects/netsuite/odbcinst.ini /etc/odbcinst.ini
ADD projects/netsuite/odbc64.ini /etc/odbc64.ini
RUN pip install --upgrade pip
RUN pip install -r requirements.txt --use-deprecated=legacy-resolver
Here is my odbcinst.ini
[ODBC Drivers]
NetSuite ODBC Drivers 8.1 = Installed
[NetSuite ODBC Drivers 8.1]
APILevel = 1
ConnectFunctions = YYN
Driver = /opt/netsuite/lib64/ivoa27.so
DriverODBCVer = 03.52
FileUsage = 0
SQLLevel = 1
Here is my odbc64.ini
[ODBC Data Sources]
NetSuite=NetSuite ODBC Drivers 8.1
[NetSuite]
Driver=/opt/netsuite/lib64/ivoa27.so
Description=Connect to your NetSuite account
Host=6765252-sb1.connect.api.netsuite.com
Port=1708
ServerDataSource=NetSuite2.com
Encrypted=1
AllowSinglePacketLogout=1
Truststore=/opt/netsuite/ca3.cer
CustomProperties=AccountID=6765252_SB1;RoleID=1035
[ODBC]
Trace=0
IANAAppCodePage=4
TraceFile=odbctrace.out
TraceDll=/opt/netsuite/lib64/ddtrc27.so
InstallDir=/opt/netsuite/odbcclient
In the requirements.txt I have pyodbc.
I have a airflow DAG on Google composer and when I try to connect using pyodbc
conn = pyodbc.connect("DRIVER={NetSuite ODBC Drivers 8.1};DSN='NetSuite2.com';UID={USER};
password={PASSWORD")
It is throwing this Error
Error in getting db connection ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/netsuite/lib64/ivoa27.so' : file not found (0) (SQLDriverConnect)")