openslide-python icon indicating copy to clipboard operation
openslide-python copied to clipboard

OSError: libopenslide.so.0: cannot open shared object file: No such file or directory

Open michaelmooreny opened this issue 5 years ago • 4 comments

Context

I am trying to install openslide for a project I'm working on

Issue type (bug report or feature request):

After running:

sudo apt-get install openslide-tools sudo apt-get install python-openslide sudo pip3 --proxy http://bcp3.cumc.columbia.edu:8080 install openslide-python

I recieve the follwoing error when importing openslide:

Traceback (most recent call last): File "script_for_mm.py", line 3, in import openslide File "/usr/local/lib/python3.5/dist-packages/openslide/init.py", line 29, in from openslide import lowlevel File "/usr/local/lib/python3.5/dist-packages/openslide/lowlevel.py", line 58, in _lib = cdll.LoadLibrary('libopenslide.so.0') File "/usr/lib/python3.5/ctypes/init.py", line 425, in LoadLibrary return self._dlltype(name) File "/usr/lib/python3.5/ctypes/init.py", line 347, in init self._handle = _dlopen(self._name, mode) OSError: libopenslide.so.0: cannot open shared object file: No such file or directory

Operating system (e.g. Fedora 24, Mac OS 10.11, Windows 10):

Ubuntu 16.04

Platform (e.g. 64-bit x86, 32-bit ARM): OpenSlide Python version (openslide.__version__):

1.1.1

OpenSlide version (openslide.__library_version__): Slide format (e.g. SVS, NDPI, MRXS):

.scn

Details

michaelmooreny avatar Sep 13 '19 14:09 michaelmooreny

Our install has this problem too and we're not sure why. We've been able to work around it by running:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/usr/lib/x86_64-linux-gnu:"

in bash before calling python. If anyone knows of a permanent solution that would be a big help but this works as a temporary fix.

markemus avatar Nov 07 '19 18:11 markemus

I have the same problem. i found image but it did not work ... My system is CentOS

superxudou avatar Dec 08 '19 09:12 superxudou

Hi @michaelmooreny. You need to install openslide-python in the following way:

  1. sudo apt update && apt install -y openslide-tools
  2. pip install openslide-python

Then try to run the command :

import openslide

Then it will work

Abhinav-Telukunta avatar Apr 01 '21 07:04 Abhinav-Telukunta

@Abhinav-Telukunta : How to solve this issue on Amazon Linux server(EC2). As it won't support apt

j-sieger avatar Mar 29 '22 11:03 j-sieger