I tried importing cv2 from opencv but i got error saying
import error: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
Since Sagemaker Studio Labs doesn't support installation of Ubuntu packages i couldn't use apt-get or yum to install libglib2.0-0.
You fix this by:
!pip uninstall opencv-python -y
Then use the headless version instead with studio:
!pip install opencv-python-headless
Ref: https://github.com/aws/amazon-sagemaker-examples/issues/1773
With this line, you can install the glib dependency for Amazon Sagemaker Studio Lab. Just run it on your notebook cell.
! conda install glib=2.51.0 -y
You also can create another virtual environment for your session that contains glib:
! conda create -n glib-test -c defaults -c conda-forge python=3 glib=2.51.0` -y
After that maybe you need albumentations to import cv2:
! pip install albumentations
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With