openslide / openslide-python

Python bindings to OpenSlide
https://openslide.org/
GNU Lesser General Public License v2.1
371 stars 180 forks source link

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

Open michaelmooreny opened 5 years ago

michaelmooreny commented 5 years ago

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

markemus commented 4 years ago

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.

superxudou commented 4 years ago

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

Abhinav-Telukunta commented 3 years ago

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

j-sieger commented 2 years ago

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