error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support
There are many methods online, and this one successfully solved my problem.
Rebuild the library with Windows, GTK+ 2.x or Cocoa support
- pip installs opencv-contrib-python. Note that the opencv-contrib-python version must be consistent with the opencv version.
- Run the following commands respectively:
Uninstall opencv-python-headless:
pip uninstall opencv-python-headless -y
Update opencv version:
pip install opencv-python --upgrade