Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
KumoLiu opened this issue Apr 16, 2024 · 0 comments · Fixed by #1693
Closed

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

KumoLiu opened this issue Apr 16, 2024 · 0 comments · Fixed by #1693
Assignees
Labels
bug Something isn't working

Comments

@KumoLiu
Copy link
Contributor

KumoLiu commented Apr 16, 2024

4:34:51  Running ./model_zoo/TCIA_PROSTATEx_Prostate_MRI_Anatomy_Model.ipynb
14:34:51  Checking PEP8 compliance...
14:34:52  Running notebook...
14:35:04  MONAI version: 1.3.1rc3
14:35:04  Numpy version: 1.24.4
14:35:04  Pytorch version: 2.3.0a0+40ec155e58.nv24.03
14:35:04  MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
14:35:04  MONAI rev id: bff4b1559a147f570fc881717eadc7b3e8a98b96
14:35:04  MONAI __file__: /home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/__init__.py
14:35:04  
14:35:04  Optional dependencies:
14:35:04  Pytorch Ignite version: 0.4.11
14:35:04  ITK version: 5.3.0
14:35:04  Nibabel version: 5.2.1
14:35:04  scikit-image version: 0.22.0
14:35:04  scipy version: 1.12.0
14:35:04  Pillow version: 10.2.0
14:35:04  Tensorboard version: 2.16.2
14:35:04  gdown version: 4.7.3
14:35:04  TorchVision version: 0.18.0a0
14:35:04  tqdm version: 4.66.2
14:35:04  lmdb version: 1.4.1
14:35:04  psutil version: 5.9.4
14:35:04  pandas version: 1.5.3
14:35:04  einops version: 0.7.0
14:35:04  transformers version: 4.39.3
14:35:04  mlflow version: 2.11.3
14:35:04  pynrrd version: 1.0.0
14:35:04  clearml version: 1.15.1
14:35:04  
14:35:04  For details about installing the optional dependencies, please visit:
14:35:04      https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies
14:35:04  
14:35:05  papermill  --progress-bar --log-output -k python3
14:35:05  /usr/local/lib/python3.10/dist-packages/papermill/iorw.py:153: UserWarning: the file is not specified with any extension : -
14:35:05    warnings.warn(
14:36:14  
Executing:   0%|          | 0/32 [00:00<?, ?cell/s]
Executing:   3%|▎         | 1/32 [00:01<00:33,  1.07s/cell]
Executing:  22%|██▏       | 7/32 [01:01<03:50,  9.20s/cell]
Executing:  28%|██▊       | 9/32 [01:05<02:39,  6.95s/cell]
Executing:  28%|██▊       | 9/32 [01:06<02:49,  7.36s/cell]
14:36:14  /usr/local/lib/python3.10/dist-packages/papermill/iorw.py:153: UserWarning: the file is not specified with any extension : -
14:36:14    warnings.warn(
14:36:14  Traceback (most recent call last):
14:36:14    File "/usr/local/bin/papermill", line 8, in <module>
14:36:14      sys.exit(papermill())
14:36:14    File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in __call__
14:36:14      return self.main(*args, **kwargs)
14:36:14    File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main
14:36:14      rv = self.invoke(ctx)
14:36:14    File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke
14:36:14      return ctx.invoke(self.callback, **ctx.params)
14:36:14    File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke
14:36:14      return __callback(*args, **kwargs)
14:36:14    File "/usr/local/lib/python3.10/dist-packages/click/decorators.py", line 33, in new_func
14:36:14      return f(get_current_context(), *args, **kwargs)
14:36:14    File "/usr/local/lib/python3.10/dist-packages/papermill/cli.py", line 254, in papermill
14:36:14      execute_notebook(
14:36:14    File "/usr/local/lib/python3.10/dist-packages/papermill/execute.py", line 134, in execute_notebook
14:36:14      raise_for_execution_errors(nb, output_path)
14:36:14    File "/usr/local/lib/python3.10/dist-packages/papermill/execute.py", line 241, in raise_for_execution_errors
14:36:14      raise error
14:36:14  papermill.exceptions.PapermillExecutionError: 
14:36:14  ---------------------------------------------------------------------------
14:36:14  Exception encountered at "In [2]":
14:36:14  ---------------------------------------------------------------------------
14:36:14  ImportError                               Traceback (most recent call last)
14:36:14  Cell In[2], line 15
14:36:14       12 import pydicom_seg
14:36:14       14 # for downloading data from TCIA
14:36:14  ---> 15 from tcia_utils import nbia
14:36:14       17 # This is the most common import command for itkWidgets.
14:36:14       18 #   The view() function opens an interactive viewer for 2D and 3D
14:36:14       19 #   data in a variety of formats.
14:36:14       20 from itkwidgets import view
14:36:14  
14:36:14  File /usr/local/lib/python3.10/dist-packages/tcia_utils/__init__.py:1
14:36:14  ----> 1 from . import nbia
14:36:14        2 from . import datacite
14:36:14        3 from . import pathdb
14:36:14  
14:36:14  File /usr/local/lib/python3.10/dist-packages/tcia_utils/nbia.py:17
14:36:14       15 import pydicom
14:36:14       16 import pydicom_seg
14:36:14  ---> 17 import rt_utils
14:36:14       18 import numpy as np
14:36:14       19 from ipywidgets import interact
14:36:14  
14:36:14  File /usr/local/lib/python3.10/dist-packages/rt_utils/__init__.py:1
14:36:14  ----> 1 from .rtstruct import RTStruct
14:36:14        2 from .rtstruct_builder import RTStructBuilder
14:36:14  
14:36:14  File /usr/local/lib/python3.10/dist-packages/rt_utils/rtstruct.py:7
14:36:14        4 from pydicom.dataset import FileDataset
14:36:14        6 from rt_utils.utils import ROIData
14:36:14  ----> 7 from . import ds_helper, image_helper
14:36:14       10 class RTStruct:
14:36:14       11     """
14:36:14       12     Wrapper class to facilitate appending and extracting ROI's within an RTStruct
14:36:14       13     """
14:36:14  
14:36:14  File /usr/local/lib/python3.10/dist-packages/rt_utils/ds_helper.py:2
14:36:14        1 import datetime
14:36:14  ----> 2 from rt_utils.image_helper import get_contours_coords
14:36:14        3 from rt_utils.utils import ROIData, SOPClassUID
14:36:14        4 import numpy as np
14:36:14  
14:36:14  File /usr/local/lib/python3.10/dist-packages/rt_utils/image_helper.py:5
14:36:14        2 from typing import List
14:36:14        3 from enum import IntEnum
14:36:14  ----> 5 import cv2 as cv
14:36:14        6 import numpy as np
14:36:14        7 from pydicom import dcmread
14:36:14  
14:36:14  File /usr/local/lib/python3.10/dist-packages/cv2/__init__.py:181
14:36:14      176             if DEBUG: print("Extra Python code for", submodule, "is loaded")
14:36:14      178     if DEBUG: print('OpenCV loader: DONE')
14:36:14  --> 181 bootstrap()
14:36:14  
14:36:14  File /usr/local/lib/python3.10/dist-packages/cv2/__init__.py:153, in bootstrap()
14:36:14      149 if DEBUG: print("Relink everything from native cv2 module to cv2 package")
14:36:14      151 py_module = sys.modules.pop("cv2")
14:36:14  --> 153 native_module = importlib.import_module("cv2")
14:36:14      155 sys.modules["cv2"] = py_module
14:36:14      156 setattr(py_module, "_native", native_module)
14:36:14  
14:36:14  File /usr/lib/python3.10/importlib/__init__.py:126, in import_module(name, package)
14:36:14      124             break
14:36:14      125         level += 1
14:36:14  --> 126 return _bootstrap._gcd_import(name[level:], package, level)
14:36:14  
14:36:14  ImportError: libGL.so.1: cannot open shared object file: No such file or directory
@KumoLiu KumoLiu self-assigned this Apr 16, 2024
@KumoLiu KumoLiu added the bug Something isn't working label Apr 16, 2024
KumoLiu added a commit to KumoLiu/tutorials that referenced this issue Apr 16, 2024
Signed-off-by: YunLiu <[email protected]>
Nic-Ma pushed a commit that referenced this issue Apr 22, 2024
Fixes #1692
workaround for #1694 

### Description

- Install dependency required by tcia_utils manually to avoid installing
opencv-python
- comment view command in the notebook

### Checks
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [ ] Avoid including large-size files in the PR.
- [ ] Clean up long text outputs from code cells in the notebook.
- [ ] For security purposes, please check the contents and remove any
sensitive info such as user names and private key.
- [ ] Ensure (1) hyperlinks and markdown anchors are working (2) use
relative paths for tutorial repo files (3) put figure and graphs in the
`./figure` folder
- [ ] Notebook runs automatically `./runner.sh -t <path to .ipynb file>`

---------

Signed-off-by: YunLiu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant