Cv2 library not getting impoeted

Cv2 is not worling from yesterday after some nix tool gor downliaded Can anyone help please

Hi @ManasiMenon thanks for your question. Can you please share a link to the affected Repl and tell me if this used to work for the same Repl in the past?

Hi,
Yes the program was working fine till this Nix updation took place and its now giving this error

![image|690x388]

ModuleNotFoundError: No module named 'numpy'
Traceback (most recent call last):
  File "main.py", line 2, in <module>
    import cv2
  File "/home/runner/Face-Detection-VideoModule/venv/lib/python3.8/site-packages/cv2/__init__.py", line 5, in <module>
    from .cv2 import *
ImportError: numpy.core.multiarray failed to import
 
KeyboardInterrupt
 
KeyboardInterrupt

Hello,
Yes it was working fine till this Nix update took place

https://replit.com/@ManasiMenon/Face-Detection-VideoModule?v=1

You need to update the packages.

Go to shell and do poetry update cv2
This will update cv2 and all its dependencies.

After this your code will work like it used to

Thanks for your response.

But it worked for only one repl

Others its giving this error even after updating
Traceback (most recent call last):
File “main.py”, line 1, in
import cv2
File “/home/runner/Green-Screen/venv/lib/python3.8/site-packages/cv2/init.py”, line 5, in
from .cv2 import *
ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory

Can you link the repl?

Yes, I can.

https://replit.com/@ManasiMenon/Green-Screen?v=1

Sorry, im not really sure on this error…
Updating packages gives a different error:

It’s ok. Thanks for helping

opencv is weird on replit. I would recommend using a repl with opencv already set up.

1 Like