Giter VIP home page Giter VIP logo

Comments (6)

v-makouz avatar v-makouz commented on August 17, 2024

Which OS is this? If isql works and pyodbc doesn't suggests they maybe using different drivers, if driver manager can open one but not the other. Which driver did you specify in isql?

from pyodbc.

silverlightjashmin avatar silverlightjashmin commented on August 17, 2024

i am using ubuntu 20.04 os and i had called same driver for both isql and pyodbc.

from pyodbc.

silverlightjashmin avatar silverlightjashmin commented on August 17, 2024

my odbcinst.ini files has

[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/usr/lib/libmsodbcsql-17.so
UsageCount=1

[ODBC Driver For MySQL]
Description=ODBC Driver For MySQL
Driver=/usr/lib/x86_64-linux-gnu/libmyodbc8a.so
UsageCount=1

[mysql]
Driver=/usr/lib/x86_64-linux-gnu/libmyodbc8a.so
UsageCount=1

[MySQL ODBC 8.3 Unicode Driver]
DRIVER=/usr/local/lib/libmyodbc8w.so
UsageCount=1

[MySQL ODBC 8.3 ANSI Driver]
DRIVER=/usr/local/lib/libmyodbc8a.so
UsageCount=1

and odbc.ini has

[test]
Driver=mysql
SERVER=10.10.13.7
USER=root
PASSWORD=Super@dm1n
DATABASE=backoffice
PORT=3306
now when i use isql test, db connection is successful and when i am calling same driver from pyodbc, it gives me
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libmyodbc8a.so' : file not found (0) (SQLDriverConnect)") error.

from pyodbc.

hurzhurz avatar hurzhurz commented on August 17, 2024

I don't know if that is helpful, but I had pretty much the same issue and somehow got it working now.
Though, first isql wasn't working, too. But after I did install one additional library package and also did set LD_LIBRARY_PATH correctly for the driver, isql was working. Pyodbc still not.

I then checked the installed version of pyodbc, which was 5.1.0 (installed yesterday via pip) and tried to downgrade it to 4.0.93. Then it suddenly worked.
But strangely, after upgrading pyodbc again, first to 5.0.1 and then to 5.1.0, it still works.
This confuses me… I don't think I have done anything other than using "pip install" between the last unsuccessful and the later successful tests...

from pyodbc.

gokul-ramasamy avatar gokul-ramasamy commented on August 17, 2024

I don't know if that is helpful, but I had pretty much the same issue and somehow got it working now. Though, first isql wasn't working, too. But after I did install one additional library package and also did set LD_LIBRARY_PATH correctly for the driver, isql was working. Pyodbc still not.

I then checked the installed version of pyodbc, which was 5.1.0 (installed yesterday via pip) and tried to downgrade it to 4.0.93. Then it suddenly worked. But strangely, after upgrading pyodbc again, first to 5.0.1 and then to 5.1.0, it still works. This confuses me… I don't think I have done anything other than using "pip install" between the last unsuccessful and the later successful tests...

What was the one additional library package that you installed? isql isn't working for me too.

from pyodbc.

hurzhurz avatar hurzhurz commented on August 17, 2024

What was the one additional library package that you installed? isql isn't working for me too.

I'm not sure anymore, but I think in my case it was one of those: libaio1, libodbc2, libodbcinst2
But that could depend on which ODBC driver you want to use.

Best is to check with ldd /path/to/odbc/driver.so if anything is listed as "not found".

from pyodbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.