AICAN-Research / FAST-Pathology

⚡ Open-source software for deep learning-based digital pathology
BSD 2-Clause "Simplified" License
122 stars 26 forks source link

openslide is installed under anaconda on Mac #44

Closed CindyQi7788 closed 2 years ago

CindyQi7788 commented 2 years ago

Hi While installing Fast-Pathogy on Mac, I encountered the error messages like below

dyld[45798]: Library not loaded: /usr/local/opt/libtiff/lib/libtiff.5.dylib Referenced from: /Users/xinqi/Desktop/DigitalPathology/fastpathology_macos10.13_1.0.0/lib/libFAST.4.3.0.dylib Reason: tried: '/usr/local/opt/libtiff/lib/libtiff.5.dylib' (no such file), '/usr/local/lib/libtiff.5.dylib' (no such file), '/usr/lib/libtiff.5.dylib' (no such file)

Reason: tried: '/usr/local/opt/jpeg/lib/libjpeg.9.dylib' (no such file), '/usr/local/lib/libjpeg.9.dylib' (no such file), '/usr/lib/libjpeg.9.dylib' (no such file)

Because those dylib files are installed under the anaconda directory, such as "opt/anaconda3/lib", I can copy each file to the new created directories one by one. But it is hard to solve the issues one by one.

If there any better way to let the FAST-pathology know the directories of those dylib files under the opt/anaconda3/lib?

Thank you very much

andreped commented 2 years ago

Neither I nor @smistad actively use anaconda, but I will try my best.

AFAIK, when you pip install openslide, you install openslide-python, which is only the python bindings to openslide. You will also need to install the actuall C library as well, which on mac can be installed using homebrew. See instructions here: https://github.com/AICAN-Research/FAST-Pathology#macos-1013-or-newer

Info about this can also be seen on the openslide github page: https://github.com/openslide/openslide-python#installation

Hope it helps!

smistad commented 2 years ago

Hi @CindyQi7788, If you have libraries installed in non-default locations, the solution is to set the environment variable DYLD_LIBRARY_PATH to the location of those libraries:

From the manual: DYLD_LIBRARY_PATH - This is a colon separated list of directories that contain libraries. The dynamic linker searches these directories before it searches the default locations for libraries. It allows you to test new versions of existing libraries.

You can set this using your terminal and run fastpathology:

export DYLD_LIBRARY_PATH="/opt/anaconda3/lib/"
/path/to/fp/bin/fastpathology

Nevertheless, I would recommend you to use homebrew as per the installation instructions of FastPathology.