We help IT Professionals succeed at work.

python database connection issue

ittechlab asked
Last Modified: 2017-05-01
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found (0) (SQLDriverConnect)")

i have freeTDS and unixODBC installed. not sure what is the cause.
Watch Question


Can you show the fragment of your code that causes the error?
ittechlabLinux Support


Here is the output from strace.

lseek(4, 0, SEEK_SET)                   = 0
lseek(4, 0, SEEK_CUR)                   = 0
read(4, "import pyodbc\nimport numpy as np"..., 8192) = 916
close(4)                                = 0
write(2, "    conn2=pyodbc.connect('driver"..., 119    conn2=pyodbc.connect('driver={SQL Server};server=mydb-server;database=myDB;trusted_connection=true')
) = 119
write(2, "pyodbc.Error: ('01000', \"[01000]"..., 129pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found (0) (SQLDriverConnect)")
) = 129
rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x3d3080f7e0}, {0x7f88423fa9a0, [], SA_RESTORER, 0x3d3080f7e0}, 8) = 0
munmap(0x7f882924c000, 262144)          = 0
munmap(0x7f882918c000, 262144)          = 0
munmap(0x7f8828be3000, 262144)          = 0
munmap(0x7f88278d5000, 262144)          = 0
close(3)                                = 0
futex(0x7f8826a31984, FUTEX_WAKE_PRIVATE, 2147483647) = 0
munmap(0x7f8836c36000, 33554432)        = 0
munmap(0x7f8834235000, 33554432)        = 0
munmap(0x7f8831834000, 33554432)        = 0
close(0)                                = 0
Linux Support
Unlock this solution and get a sample of our free trial.
(No credit card required)
ittechlabLinux Support


found the solution myself.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.