# Can't import cv2 when running make test-submission

**URL:** <https://community.drivendata.org/t/cant-import-cv2-when-running-make-test-submission/8876>\
**Category:** VisioMel Challenge\
**Created:** [April 20, 2023, 9:57am UTC](https://community.drivendata.org/t/cant-import-cv2-when-running-make-test-submission/8876 "2023-04-20T09:57:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BryanB](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@BryanB](https://community.drivendata.org/u/BryanB)\
**Post date:** [April 20, 2023, 9:57am UTC](https://community.drivendata.org/t/cant-import-cv2-when-running-make-test-submission/8876/1 "2023-04-20T09:57:59Z")

</div>

When i run `make test-submission` locally, I get this error

> - echo ‘Running code submission with Python’  
> Running code submission with Python
> - conda run --no-capture-output -n condaenv python main.py  
> Traceback (most recent call last):  
> File “/code\_execution/main.py”, line 7, in   
> import cv2  
> ImportError: libGL.so.1: cannot open shared object file: No such file or directory  
> ERROR conda.cli.main\_run:execute(47): `conda run python main.py` failed. (See above for error)  
> make: \*\*\* [Makefile:167: test-submission] Error 1

I am using the image: [visiomelmelanoma.azurecr.io/visiomelmelanoma-competition:gpu-latest](http://visiomelmelanoma.azurecr.io/visiomelmelanoma-competition:gpu-latest) (220af7795b9c)

Has anyone encountered the same issue ?

Thanks in advance, it would really help

---

<div class="post-metadata">

**Author:** ![emily](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@emily](https://community.drivendata.org/u/emily)\
**Post date:** [April 20, 2023, 8:57pm UTC](https://community.drivendata.org/t/cant-import-cv2-when-running-make-test-submission/8876/2 "2023-04-20T20:57:00Z")

</div>

Make sure you’re using the latest image. I’d suggest deleting that image and re-running `make pull`.

---

<div class="post-metadata">

**Author:** ![trislaz](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@trislaz](https://community.drivendata.org/u/trislaz)\
**Post date:** [April 24, 2023, 8:35am UTC](https://community.drivendata.org/t/cant-import-cv2-when-running-make-test-submission/8876/3 "2023-04-24T08:35:19Z")

</div>

After building the container from scratch, it still gives me this error when loading cv2

---

<div class="post-metadata">

**Author:** ![BryanB](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@BryanB](https://community.drivendata.org/u/BryanB)\
**Post date:** [April 24, 2023, 10:49am UTC](https://community.drivendata.org/t/cant-import-cv2-when-running-make-test-submission/8876/4 "2023-04-24T10:49:51Z")

</div>

Hello emily,

I deleted current image and re-ran make pull (cpu and gpu) and I am still getting the same error message.

---

<div class="post-metadata">

**Author:** ![emily](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@emily](https://community.drivendata.org/u/emily)\
**Post date:** [April 24, 2023, 9:11pm UTC](https://community.drivendata.org/t/cant-import-cv2-when-running-make-test-submission/8876/5 "2023-04-24T21:11:45Z")

</div>

Thanks for raising this issue, there was indeed a dependency missing. This should now be fixed in the latest image.

---

<div class="post-metadata">

**Author:** ![BryanB](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@BryanB](https://community.drivendata.org/u/BryanB)\
**Post date:** [April 24, 2023, 10:58pm UTC](https://community.drivendata.org/t/cant-import-cv2-when-running-make-test-submission/8876/6 "2023-04-24T22:58:32Z")

</div>

It works for me, thanks
