ENHANCE-PET / MOOSE

MOOSE (Multi-organ objective segmentation) a data-centric AI solution that generates multilabel organ segmentations to facilitate systemic TB whole-person research.The pipeline is based on nn-UNet and has the capability to segment 120 unique tissue classes from a whole-body 18F-FDG PET/CT image.
https://enhance.pet
GNU General Public License v3.0
196 stars 28 forks source link

BUG: ImportError: libGL.so.1: cannot open shared object file: No such file or directory #67

Closed rullator closed 1 year ago

rullator commented 1 year ago

Thanks for providing version 2 of your fantastic tool MOOSE!

When following your installation instructions and finally starting moose via:

moosez -h

I received the following error:

Traceback (most recent call last):
  File "/home/[...]/MOOSE2.0/moose-env/bin/moosez", line 5, in <module>
    from moosez.moosez import main
  File "/home/[...]/MOOSE2.0/moose-env/lib/python3.9/site-packages/moosez/__init__.py", line 7, in <module>
    from . import moosez
  File "/home/[...]/MOOSE2.0/moose-env/lib/python3.9/site-packages/moosez/moosez.py", line 36, in <module>
    from moosez import image_processing
  File "/home/[...]/MOOSE2.0/moose-env/lib/python3.9/site-packages/moosez/image_processing.py", line 32, in <module>
    import cv2
  File "/home/[...]/MOOSE2.0/moose-env/lib/python3.9/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/home/[...]/MOOSE2.0/moose-env/lib/python3.9/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/software/all/Anaconda3/2021.11/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

I am working remotely via SSH on a supercomuting cluster. I believe the error is generated via the opencv-python which installs GUI functionality.

I could fix the error by installing: pip install opencv-python-headless

opencv-python-headless is a version of opencv-python that doesn't include the GUI features, so it also doesn't depend on the graphics libraries. It seems to be a good solution for setups that don't have a full graphical environment.

LalithShiyam commented 1 year ago

Hi @rullator, many thanks for pointing out the issue and also fixing it 👍🏾! Did you also check it in a Gui-environment? Just asking, because we need to make sure, it works in both the cases. It's OK if you haven't, just let us know so that we can run some tests, before making a PR! Thanks again for the find 🥇

rullator commented 1 year ago

No, I didn't test it in GUI environment.. just command line :)

LalithShiyam commented 1 year ago

@mprires can you please test this in windows environment? And see after @rullator's suggested change nothing breaks.

LalithShiyam commented 1 year ago

I can confirm nothing breaks in Linux. @mprires whenever you have time, run it in windows.

mprires commented 1 year ago

I tested it and the fix also works in GUI environment! Thank you for the find :)

LalithShiyam commented 1 year ago

Great, so closing it :) thanks again @rullator!