[Solved] Import cv2- no module exists error while deploying

I hosted on streamlit sharing,
so change the requirements.txt as follows


This successfully worked for me, Hope this helps @aniketwattamwar.

By the way while running the code I encountered few errors:

  1. In Image Processing
    ValueError: not enough values to unpack (expected 3, got 2)

  2. In Feature Detection in images
    AttributeError: module ‘cv2.cv2’ has no attribute ‘xfeatures2d’

After fixing the error and successfully deploying, please edit the title and add [Solved] at the beginning, it will be helpful for similar error encounters.

1 Like