Python opencv Aruco “No module named 'cv2.aruco'”

China☆狼群 提交于 2019-12-05 04:40:13

If cv2.aruco is not found, try installing opencv-contrib-python, such as by running the following (for the default Python installation):

pip install opencv-contrib-python

Or for a specific Python installation (in this case Python 3)

python3 -m pip install opencv-contrib-python

Then try re-running the script trying to access cv2.aruco.

If cv2.aruco is not found, first make sure that opencv-python is not installed.

for that you can use:

pip uninstall opencv-python

Then install:

pip install opencv-contrib-python

We are uninstalling opencv-python because installing two packages of opencv will contradict each other and will not let the other one install.

In my case both opencv-python and opencv-contrib-python were installed when I was getting the above error.

So I uninstalled opencv-python using

pip uninstall opencv-python

Run the program and same error. Then I uninstalled opencv-contrib-python

pip uninstall opencv-contrib-python

After that I reinstalled opencv-contrib-python using

pip install opencv-contrib-python

And run the program, no error now. So I upvoted both the above answers :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!