Docker Community Forums

Share and learn in the Docker community.

Scrypt Python SQL Server


(Tsdvserrano) #1

I am new to docker and python. I am running a docker image for tensorflow for image classification in Windows 10. I like to save the output into HOST SQL Server. I have modified the python code for the insert. pyodbc was not working initially. But I have run below commands and it is working.

RUN
apt-get update && apt-get install -y gcc unixodbc-dev

RUN
pip install pyodbc

But I am still getting the below error while try to run the insert python script. What should I do next?

pyodbc.Error: (‘01000’, “[01000] [unixODBC][Driver Manager]Can’t open lib ‘SQL Server’ : file not found (0) (SQLDriverConnect)”)

cnxn = pyodbc.connect(‘Trusted_Connection=yes’, driver = ‘{SQL Server}’,server = ‘127.0.0.1’, port=‘1433’, user=‘sa’, password=’*****’, database=’****’)