# Error when importing cv2.aruco in python file

**URL:** <https://discourse.slicer.org/t/error-when-importing-cv2-aruco-in-python-file/11176>\
**Category:** Support\
**Tags:** opencv\
**Created:** [April 18, 2020, 2:02pm UTC](https://discourse.slicer.org/t/error-when-importing-cv2-aruco-in-python-file/11176 "2020-04-18T14:02:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyrillajarge](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@cyrillajarge](https://discourse.slicer.org/u/cyrillajarge)\
**Post date:** [April 18, 2020, 2:02pm UTC](https://discourse.slicer.org/t/error-when-importing-cv2-aruco-in-python-file/11176/1 "2020-04-18T14:02:00Z")

</div>

Hi guys,

I’m developing a module for a school project in which I need to use OpenCV combined with Aruco.  
I have installed the extension SlicerOpenCV and OpenCV is working correctly when I import `cv2` in my python file.  
However, it seems that there is no aruco submodule. When I do `cv2.aruco.some_function`, I get the error `object has no attribute 'aruco'`.  
I’ve installed `opencv-contrib-python` manually using pip in the python interpreter but it doesn’t fix the problem.  
cv2 version installed is **3.3.1** on 3DSlicer.

Operating system: MacOS Catalina **10.15.2**  
Slicer version: **4.10.2**

Many thanks in advance!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 18, 2020, 2:03pm UTC](https://discourse.slicer.org/t/error-when-importing-cv2-aruco-in-python-file/11176/2 "2020-04-18T14:03:44Z")

</div>

If you switch to a recent Slicer-4.11 version then you can run [`slicer.util.pip_install()`](https://slicer.readthedocs.io/en/latest/developer_guide/slicer.html#slicer.util.pip_install) to install any python package. No need to use SlicerOpenCV anymore.

---

<div class="post-metadata">

**Author:** ![cyrillajarge](https://avatars.discourse-cdn.com/v4/letter/c/6f9a4e/32.png) [@cyrillajarge](https://discourse.slicer.org/u/cyrillajarge)\
**Post date:** [April 20, 2020, 6:44pm UTC](https://discourse.slicer.org/t/error-when-importing-cv2-aruco-in-python-file/11176/3 "2020-04-20T18:44:00Z")

</div>

It worked!  
Thank you 🙂
