0

The command

import cv2 

on Watson Studio results in the error

ImportError                               Traceback (most recent call last)<ipython-input-1-72fbbcfe2587> in <module>()----> 1 import cv2
ImportError: No module named 'cv2'

I'm not sure if I need to install opencv upfront and how to do this in a cloud environment like Watson Studio?

jpsstack
  • 1,221
  • 4
  • 18
  • 29

1 Answers1

1

cv2 is part of opencv-python package. Please install the pypi hosted libararies using !pip magic in jupyter notebook.

!pip install opencv-python

Then run the import cv2.

See this shared notebook

https://dataplatform.ibm.com/analytics/notebooks/v2/a0e50c53-ea28-4b78-800f-35cae2211389/view?access_token=b129fa46626e1bf317de18c9241af375d9a9ac8e11561e3735569050fe0b8839

Also see this documentation for installing third party libraries.

https://datascience.ibm.com/docs/content/analyze-data/importing-libraries.html

charles gomes
  • 2,145
  • 10
  • 15