I have a shared library file part of a larger program. I seem to get many of these errors with all the shared libraries, so I think I've narrowed down my issue to something to do with this.
I have a file called libMdsdcl.so. Just for testing purposes I've placed it in a folder by itself and ran the following lines to repeat the error:
In [1]: import ctypes as c
In [2]: from ctypes.util import find_library
In [3]: name = 'Mdsdcl'
In [4]: libname = find_library(name)
In [5]: c.CDLL(libname)
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-6-7c40f200b197> in <module>()
----> 1 c.CDLL(libname)
/usr/lib/python3.6/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
346
347 if handle is None:
--> 348 self._handle = _dlopen(self._name, mode)
349 else:
350 self._handle = handle
OSError: libreadline.so.6: cannot open shared object file: No such file or directory
This isn't my code, but rather it is part of a code that seems to work for everyone who installs it. Based off other similar questions, I checked the architecture of my python installation and the file, and they're both 64-bit. Could something be wrong with my libreadline or something? I actually just upgraded to Ubuntu 18.04 right before this too.
For reference this is MDSplus on the tiny, tiny off chance someone seeing this is familiar with it.
c.CDLL(libname)is totally incorrect. Specify the lib's whole name:name = "libMdsdcl.so". If that still doesn't work either specify it by its full path, or add its dir in ${LD_LIBRARY_PATH}.print(libname)beforec.CDLL(libname). Ah, d you have readline package installed? If not,sudo apt-get install libreadline6.