Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

60 Days of Data Days! Live and on-demand sessions, challenges, study groups and more! And it's all FREE!. Join now. Learn more

Reply
sliu736
New Member

ultralytics libGL error

Hi I am trying to load cv2 package in fabrics notebook and the error is: 

ImportError: libGL.so.1: cannot open shared object file: No such file or directory
I've tried to install both opencv-python and opencv-python-headless, but neither of them works. 

sliu736_1-1731047254611.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @sliu736 

Thanks for FabianSchut's positive reply. When I install only the opencv-python package I get the same error as you, but after installing the opencv-python-headless package, the import command executes fine. You can try installing both packages

vyaningymsft_0-1731056541446.png

vyaningymsft_1-1731056645170.png


Best Regards,
Yang

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi, @sliu736 

Thanks for FabianSchut's positive reply. When I install only the opencv-python package I get the same error as you, but after installing the opencv-python-headless package, the import command executes fine. You can try installing both packages

vyaningymsft_0-1731056541446.png

vyaningymsft_1-1731056645170.png


Best Regards,
Yang

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

FabianSchut
Solution Sage
Solution Sage

If I look at the documentation of the cv2, you should only have one package installed at a time: https://pypi.org/project/opencv-python/. Can you try to uninstall all four potential packages: 
opencv-python
opencv-contrib-python
opencv-python-headless
opencv-contrib-python-headless

and reinstall only one? 

And probably you want to reinstall the opencv-python-headless, since that one is less depend on other packages: https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-n...

Hi here is the list of packages I have.

sliu736_0-1731048166720.png

sliu736_1-1731048261245.png

And now cv2 cant be found. So confusing

Can you create a new environment in Fabric and install the headless version once there?

Hi, that is already my current solution. And more confusing is that even if the only package installed was opencv-python-headless, opencv-python still exists in the pip list. 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

June Fabric Update Carousel

Fabric Monthly Update - June 2026

Check out the June 2026 Fabric update to learn about new features.

Top Solution Authors