Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

conda can't find cv2 lib located at /opt/conda/python/3.6/cv2.cpython-36m-x86_64-linux-gnu.so

I have compiled opencv from source. and used following flag to install install it in anaconda lib path -DCMAKE_INSTALL_PREFIX=/opt/conda -DCMAKE_BUILD_TYPE=Release (blah blah) after running make install the opencv lib gets installed at /opt/conda/python/3.6/cv2.cpython-36m-x86_64-linux-gnu.so which is a bit strange as I was expecting to be installed in /opt/conda/lib directory. More importantly when I try to do import cv2 inside python terminal, I get a ModuleNotFoundError error. OpenCV is also not showing in conda list. Am I missing something here? Where should OpenCV be installed to get it imported in Ananconda ?

For completeness my LD_LIBRARY_PATH and PATH are given below:

LD_LIBRARY_PATH= /opt/conda/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64

PATH=/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

conda can't find cv2 lib located at /opt/conda/python/3.6/cv2.cpython-36m-x86_64-linux-gnu.so

I have compiled opencv from source. source and used following flag to install install it in anaconda lib path -DCMAKE_INSTALL_PREFIX=/opt/conda -DCMAKE_BUILD_TYPE=Release (blah blah) after running make install the opencv lib gets installed at /opt/conda/python/3.6/cv2.cpython-36m-x86_64-linux-gnu.so which is a bit strange as I was expecting to be installed in /opt/conda/lib directory. More importantly when I try to do import cv2 inside python terminal, I get a ModuleNotFoundError error. OpenCV is also not showing in conda list. Am I missing something here? Where should OpenCV be installed to get it imported in Ananconda ?

For completeness my LD_LIBRARY_PATH and PATH are given below:

LD_LIBRARY_PATH= /opt/conda/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64

PATH=/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

conda can't find cv2 lib located at /opt/conda/python/3.6/cv2.cpython-36m-x86_64-linux-gnu.so

I have compiled opencv from source and used following flag to install it in anaconda lib path -DCMAKE_INSTALL_PREFIX=/opt/conda -DCMAKE_BUILD_TYPE=Release (blah blah) after running make install the opencv lib gets installed at /opt/conda/python/3.6/cv2.cpython-36m-x86_64-linux-gnu.so which is a bit strange as I was expecting to be installed in /opt/conda/lib directory. More importantly when I try to do import cv2 inside python terminal, I get a ModuleNotFoundError error. OpenCV is also not showing in conda list. Am I missing something here? Where should OpenCV be installed to get it imported in Ananconda ?

For completeness my LD_LIBRARY_PATH and PATH are given below:

LD_LIBRARY_PATH= /opt/conda/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64

PATH=/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

conda can't find cv2 lib located at /opt/conda/python/3.6/cv2.cpython-36m-x86_64-linux-gnu.so

I have compiled opencv from source and used following flag to install it in anaconda lib path -DCMAKE_INSTALL_PREFIX=/opt/conda -DCMAKE_BUILD_TYPE=Release (blah blah) after running make install the opencv lib gets installed at /opt/conda/python/3.6/cv2.cpython-36m-x86_64-linux-gnu.so which is a bit strange as I was expecting to be installed in /opt/conda/lib directory. More importantly when I try to do import cv2 inside python terminal, I get a ModuleNotFoundError error. OpenCV is also not showing in conda list. Am I missing something here? Where should OpenCV be installed to get it imported in Ananconda ?

For completeness my LD_LIBRARY_PATH and PATH are given below:

LD_LIBRARY_PATH= /opt/conda/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64

PATH=/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

PS: I am able to import OpenCV in Anaconda after doing cp /opt/conda/python/3.6/cv2.cpython-36m-x86_64-linux-gnu.so /opt/conda/lib/python3.6/site-packages/cv2.so but this is not a proper solution as I have to do it after each compilation. What CMAKE_INSTALL_PREFIX should I set to get it installed at the right place.