rsnk96 / Ubuntu-Setup-Scripts

Scripts to help you set up your Ubuntu quickly, especially if you're in any subfield of Data Science or AI!
Apache License 2.0
126 stars 76 forks source link

Fix OpenCV build on Anaconda #86

Closed rajat2004 closed 4 years ago

rajat2004 commented 4 years ago

Noticed while looking at Travis build of latest master

Traceback (most recent call last):
  File "extras/opencv_test.py", line 1, in <module>
    import cv2
  File "/opt/anaconda3/lib/python3.7/site-packages/cv2/__init__.py", line 96, in <module>
    bootstrap()
  File "/opt/anaconda3/lib/python3.7/site-packages/cv2/__init__.py", line 86, in bootstrap
    import cv2
ImportError: /opt/anaconda3/bin/../lib/libgio-2.0.so.0: undefined symbol: g_ref_count_inc

For some reason the build is not shown as failed which needs to be looked into

rajat2004 commented 4 years ago

Looks like I broke more stuff than fixed, it's failing during linking at the end itself, Also need to make sure that Travis shows the build as broken

rajat2004 commented 4 years ago

I've dropped the first commit, since that doesn't seem to be the correct fix This might be happening due to the recent glib update which libgio is a part of - https://anaconda.org/anaconda/glib

rsnk96 commented 4 years ago

I wonder if we're going wrong somewhere.... will be worth checking if this script works out of the box for conda

https://github.com/sarathyRL/OpenCV/blob/master/OpenCV-Build.sh

rajat2004 commented 4 years ago

Could be Regarding the script you linked, it seems strange that it would work, 2 envs are being used, with different Python executable being used. I don't see any other difference

rajat2004 commented 4 years ago

Closing this since the problem has been exposed by changes in #88 and Travis build for Conda+OpenCV fails Will try to fix this and open a new PR