How to Upgrade OpenCV to Specific Version Using Pip?

Refresh

1 weeks ago

Views

11 time

0

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?

1 answers

1

Все, что вам нужно сделать, это поставить версию в команде следующим образом

pip3 install --upgrade opencv-python==3.4.0