首页 > 解决方案 > How to upgrade OpenCV in Anaconda (windows)?

问题描述

everyone.

My problem is that I need the last version of OpenCV (4.3.0) to run a code but when I checked my version of opencv with the line:

print(cv2.__version__)

it said that my version of cv2 is the 3.4.2. So I went into my anaconda, environment, I marked opencv for upgrade, but it seems it is the last version it can install. So I tried a command in the cmd.prompt of anaconda :

pip install --upgrade opencv-python==4.3.0.36

And then, when I checked "opencv" in the installed modules of my anaconda environment, I saw two opencv. One is "opencv" version 3.4.2, and then, just below, there is "opencv-pyton" version 4.3.0. BUT, when I checked again my version of cv2 with "print(cv2.version)", it was still telling me that my version is 3.4.2 (I also tried to uninstall the opencv 3.4.2 to see if anaconda would then take into account the opencv-pyton 4.3.0 but no, it gives me an error).

Does anyone have an idea how to upgrade my version of opencv with anaconda ? Thanks everyone.

标签: pythonopencvanaconda

解决方案


您可能在 .condarc 设置中缺少 conda-forge 频道。

试试这个从 conda-forge 安装:

conda install -c conda-forge opencv=4.3.0

推荐阅读