# Module 'cv2' has no attribute 'INTER\_AREA'

**URL:** <https://forum.opencv.org/t/module-cv2-has-no-attribute-inter-area/13821>\
**Category:** Python\
**Tags:** python, programming, imutils\
**Created:** [July 11, 2023, 10:47am UTC](https://forum.opencv.org/t/module-cv2-has-no-attribute-inter-area/13821 "2023-07-11T10:47:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![parsman\_lin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/parsman_lin/32/8240_2.png) [@parsman\_lin](https://forum.opencv.org/u/parsman_lin)\
**Post date:** [July 11, 2023, 10:47am UTC](https://forum.opencv.org/t/module-cv2-has-no-attribute-inter-area/13821/1 "2023-07-11T10:47:02Z")

</div>

I have problem starting zoneminder command when it gives error AttributeError: module ‘cv2’ has no attribute ‘INTER\_AREA’

```auto
sudo -u www-data /var/lib/zmeventnotification/bin/zm_detect.py 1 1
Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 15, in <module>
    import imutils
  File "/usr/local/lib/python3.10/dist-packages/imutils/ __init__.py", line 8, in <module>
    from .convenience import translate
  File "/usr/local/lib/python3.10/dist-packages/imutils/convenience.py", line 65, in <module>
    def resize(image, width=None, height=None, inter=cv2.INTER_AREA):
AttributeError: module 'cv2' has no attribute 'INTER_AREA'

```

Ubuntu 22.04.2 LTS  
ZoneMinder v1.36.33  
Opencv 4.8 ( CUDA Version: 12.1 )  
Python 3.10.6

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [July 11, 2023, 11:05am UTC](https://forum.opencv.org/t/module-cv2-has-no-attribute-inter-area/13821/2 "2023-07-11T11:05:36Z")

</div>

```auto
$ pip list | grep opencv

```

and better call that with `sudo -u www-data` too, because who knows how many pythons are on your system and what virtual environments you might have enabled in your own user login.

---

<div class="post-metadata">

**Author:** ![parsman\_lin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/parsman_lin/32/8240_2.png) [@parsman\_lin](https://forum.opencv.org/u/parsman_lin)\
**Post date:** [July 11, 2023, 12:25pm UTC](https://forum.opencv.org/t/module-cv2-has-no-attribute-inter-area/13821/3 "2023-07-11T12:25:52Z")

</div>

I compiled and installed opencv according to [this tutorial](https://pyimagesearch.com/2020/02/03/how-to-use-opencvs-dnn-module-with-nvidia-gpus-cuda-and-cudnn/)  
And all the steps were done correctly (because I want to use gpu)

I searched a lot about it, but I don’t know how to solve this problem

(opencv\_cuda)root@lin:  
python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux

> import cv2  
> cv2. **version**  
> ‘4.8.0’

(opencv\_cuda) root@lin:~# sudo -u www-data pip list | grep opencv  
WARNING: The directory ‘/var/www/.cache/pip’ or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo’s -H flag.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [July 11, 2023, 12:52pm UTC](https://forum.opencv.org/t/module-cv2-has-no-attribute-inter-area/13821/4 "2023-07-11T12:52:07Z")

</div>

> [@parsman\_lin](#):
>
> this tutorial

if you have trouble with that tutorial, you should contact the author for suupport.

the point of asking you for a `pip list` is to see if you have conflicting packages. there must be exactly one opencv package, not more.

please figure out how to get that list.

please run your code _normally_, not as a different user.

debug this. figure out what changes affect the outcome.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [July 13, 2023, 5:53am UTC](https://forum.opencv.org/t/module-cv2-has-no-attribute-inter-area/13821/6 "2023-07-13T05:53:51Z")

</div>

no, this here isn’t an IDE issue. this here is an actual execution issue.
