ysbecca / py-wsi

Python package for dealing with whole slide images (.svs) for machine learning, particularly for fast prototyping. Includes patch sampling and storing using OpenSlide. Patches may be stored in LMDB, HDF5 files, or to disk. It is highly recommended to fork and download this repository so that personal customisations can be made for your work.
https://ysbecca.github.io/programming/2018/05/22/py-wsi.html
GNU General Public License v3.0
161 stars 93 forks source link

WinError 126 The specified module could not be found #18

Closed patkalie closed 5 years ago

patkalie commented 5 years ago

Hi. When I try: "import py_wsi" in a script window in the Python IDE I get the following error "WinError 126 The specified module could not be found". I have installed the other required packages I think. According to the intellisense in the IDE the py_wsi is installed since member objects are displayed. What could be the problem with my installation? Do I have to install openslide in addition to openslide-python? Kind regards Kai-Inge

import py_wsi Traceback (most recent call last): File "<pyshell#0>", line 1, in import py_wsi File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\py_wsi__init.py", line 6, in from .patch_reader import * File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\py_wsi\patch_reader.py", line 10, in from openslide import open_slide File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\openslide__init__.py", line 29, in from openslide import lowlevel File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\openslide\lowlevel.py", line 41, in _lib = cdll.LoadLibrary('libopenslide-0.dll') File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\ctypes\init.py", line 426, in LoadLibrary return self._dlltype(name) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\ctypes\init.py", line 348, in init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 126] The specified module could not be found

ysbecca commented 5 years ago

Hi Kai-Inge, it looks like the error is coming from openslide. I would debug this separately, and make sure that from a Python shell you are able to do import openslide without error. As you can see in the Python openslide binding, you must first install OpenSlide, not just a pip install openslide.

https://github.com/openslide/openslide-python

patkalie commented 5 years ago

Hi ysbecca. Thank you very much! Downloading the openslide files did the trick. :-) Kind regards, Kai-Inge