0

I need to open SVS images in Python 3.7 and it seems that Openslide is the only module capable of opening images of that size (30k*30k pixels). I have used pip install openslide-python as well as python -m pip install openslide-python and pip 3 install... etc.

I know the module has been successfully installed because if I run any of those commands again the command line returns requirement already satisfied however when I run Python and try to import openslide it gives the error at the bottom.

My guess was that the .whl or .tar.gz files were in the wrong path so I made a bunch of copies and put them in the openslide folders within the Anaconda3 folder. The error persists. I have included the full error code below for clarity.

Extra: If I run help("modules") openslide shows up along with numpy, math, sklearn etc. I can import and run all other modules without issue.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\brimk\Anaconda3\lib\site-packages\openslide\__init__.py", line 29, in <module>
    from openslide import lowlevel
  File "C:\Users\brimk\Anaconda3\lib\site-packages\openslide\lowlevel.py", line 41, in <module>
    _lib = cdll.LoadLibrary('libopenslide-0.dll')
  File "C:\Users\brimk\Anaconda3\lib\ctypes\__init__.py", line 434, in LoadLibrary
    return self._dlltype(name)
  File "C:\Users\brimk\Anaconda3\lib\ctypes\__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
Kyle Brim
  • 11
  • 2

1 Answers1

1

My issue was resolved by the answer from my hero!

It seems that, at least for Openslide, running Python from the Path to the Bin is the easiest solution. It can be done this way.

  1. Download the Windows Binary here.
  2. Extract the download to whatever path you want.
  3. Open command window
  4. pip3 install openslide-python (pip2 if Python 2)
  5. cd C:\Users\Path\to\Openslide-Win64-20171122\bin
  6. python
  7. import openslide

In the future you will have to run python from the path to the Openslide bin (Step 4). This can be done more rigorously by adding that file path to the PATH as described in detail here as well as in the answer above.

Kyle Brim
  • 11
  • 2