0

I am trying to import pyodbc library in Glue python shell. There is some import error.

ImportError: libodbc.so.2: cannot open shared object file: No such file or directory

Umer
  • 1
  • 3
  • the error told you everything. Did you install the required libraries? – adrtam Apr 09 '19 at 14:38
  • @adrtam yes I have added the libodbc.so.2 file in the same directory, but it does not read it. This is the structure of egg file. - pyodbc.egg -- libodbc.so.2 -- pyodbc.so – Umer Apr 09 '19 at 18:00
  • No. Same directory doesn't work, unless you set your LD_PRELOAD environment variable or some others to pick up the local directory. Correct way to install is to put it in /usr/lib – adrtam Apr 09 '19 at 18:01
  • @adrtam I have tried placing the logodbc.so.2 file in /usr/lib path. Still no luck. – Umer Apr 09 '19 at 19:34
  • what distribution/OS? how you get your libodbc.so? why not install that by rpm (redhat/centos) or dpkg (debian/ubuntu) or pkg (freebsd)? – adrtam Apr 09 '19 at 19:46
  • @adrtam, I am trying to use pyodbc library in glue python shell. To create the package I am using amazon linux image. In that I am installing all dependencies including (unixODBC, unixODBC-dev, pyodbc). After this I am downloading the code of pyodbc and creating the egg file using setup.py file. – Umer Apr 09 '19 at 20:04
  • Does this help? https://stackoverflow.com/a/50925535/9214517 – adrtam Apr 09 '19 at 20:16

0 Answers0