andrewleech / fdb_embedded

Fork of firebird fdb driver with bundled firebird embedded libraries. Forked from: svn://svn.code.sf.net/p/firebird/code/python/fdb/trunk
Other
7 stars 3 forks source link

Requires libncurses5 instead of 6? #2

Open glubsy opened 6 years ago

glubsy commented 6 years ago

Installed after doing a small modification to the setup.py by changing "python" to "python2" and changing httplib to http.client as httplib in build_firebird.py (since httplib is deprecated now). Then:

python setup.py bdist_wheel sudo pip install dist/fdb_embedded*.whl

and it seems to have installed correctly.

Now calling fdb_embedded in my script yields the following error:

Traceback (most recent call last):
  File "./fdb_query.py", line 10, in <module>
  File "/usr/lib/python3.6/site-packages/fdb_embedded/fbcore.py", line 656, in connect
    load_api(fb_library_name)
  File "/usr/lib/python3.6/site-packages/fdb_embedded/fbcore.py", line 182, in load_api
    setattr(sys.modules[__name__],'api',fbclient_API(fb_library_name))
  File "/usr/lib/python3.6/site-packages/fdb_embedded/ibase.py", line 1214, in __init__
    fb_library = CDLL(fb_library_name)
  File "/usr/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libncurses.so.5: cannot open shared object file: No such file or directory

Do I need to find libncurses5? Am I missing something obvious? Running Arch Linux, my libncurses shared libs are all version 6.

Edit: running an strace, it's clearly looking for libncurses5... maybe it should be bundled with it?

openat(AT_FDCWD, "/usr/lib/python3.6/site-packages/fdb_embedded/lib/libncurses.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/tls/libncurses.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libncurses.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
glubsy commented 6 years ago

Current workarounds?

OSError: libncurses.so.5: cannot open shared object file: No such file or directory

doing a symbolic link from my current Hopper installation: sudo ln -s /opt/hopper-v4/lib/libncurses.so.5 /usr/lib/python3.6/site-packages/fdb_embedded/lib

OSError: libicuuc.so.30: cannot open shared object file: No such file or directory

doing a symbolic link: sudo ln -s /usr/lib/python3.6/site-packages/fdb_embedded/lib/libicuuc.so{,.30}

OSError: libicudata.so.30: cannot open shared object file: No such file or directory

doing a symbolic link: sudo ln -s /usr/lib/python3.6/site-packages/fdb_embedded/lib/libicudata.so{,.30}

OSError: libicui18n.so.30: cannot open shared object file: No such file or directory

doing a symbolic link: sudo ln -s /usr/lib/python3.6/site-packages/fdb_embedded/lib/libicui18n.so{,.30}

OSError: libtinfo.so.5: cannot open shared object file: No such file or directory

doing a symbolic link from my hopper installation: sudo ln -s /opt/hopper-v4/lib/libtinfo.so.5 /usr/lib/python3.6/site-packages/fdb_embedded/lib/

I sound like a robot. bleep bloop. Or like a dumb user. derp derp.

andrewleech commented 6 years ago

Hi @glubsy, I haven't looked at this for a few years so I'm not too sure.... I never actually ended up using this in a project.

I suspect you may do well by updating the version of the library that's bundled; see settings and urls in https://github.com/andrewleech/fdb_embedded/blob/embedded/build_firebird.py

glubsy commented 6 years ago

Thanks, I guess I should have looked closer indeed. For now, everything seems to work for me. But if I ever get around to successfully updating the install script, I'll make a pull request.

by the way, thanks for sharing this fork, it's quite useful to me (I think... just messing around)

Cheers~