Ask Your Question

import cv2 error in python

asked 2019-09-13 12:31:45 -0500

endo gravatar image

I have installed opencv 3.4.0 with both python2.7 and python3.5 bindings. I am able to import and use opencv successfully in python2 but not python3. I get the following error:

ImportError: /usr/local/lib/ undefined symbol: _ZNK2cv3dnn19experimental_dnn_v33Net14getLayerShapesERKSt6vectorIiSaIiEEiRS3_IS5_SaIS5_EESA

This worked transiently until I had to upgrade CUDNN for CUDA compatibility purposes. I have cleaned, uninstalled and reinstalled opencv but this issue is not resolved.

My additional setup is as follows: Ubuntu 16.04 cuDNN 7.6.1 (I have tried with 7.6.3 as well) CUDA 10.0

I am limited to keeping the above versions because of other dependencies.

Thanks in advance.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2019-09-14 00:11:32 -0500

holger gravatar image

Thats python dependency hell(why this lang installs libs globally) - thats why i dont like this language too much. Try seperating your python installation with virtual env and install opencv twice(for each python version).

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-09-13 12:31:45 -0500

Seen: 211 times

Last updated: Sep 14 '19