Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Upgrade OpenCV to Specific Version Using Pip?

I want to install OpenCV 3.4.0 on Ubuntu 16.04. I tried to build from source following tutorial on internet but run to this problem:

ImportError: /home/ivan/.virtualenvs/cv/lib/python3.5/site-packages/cv2.so: undefined symbol: _ZTIN2cv3dnn19experimental_dnn_v35LayerE

So I decided to just upgrade OpenCV using pip following solution on github https://github.com/CharlesShang/FastMaskRCNN/issues/111:

pip3 install --upgrade opencv-python

It works fine, cv2 successfully imported. But it directly upgraded to opencv 4.0.0 . Is there any way to upgrade opencv to specific version (ex: 3.4.0) using pip?

like image 877
gameon67 Avatar asked Oct 27 '25 21:10

gameon67


1 Answers

All you have to do is to put the version in the command as follows

pip3 install --upgrade opencv-python==3.4.0
like image 62
InAFlash Avatar answered Oct 30 '25 11:10

InAFlash