cv2 import error on Jupyter notebook

前端 未结 9 854
误落风尘
误落风尘 2020-12-03 08:48

I\'m trying to import cv2 on Jupyter notebook but I get this error:

ImportError: No module named cv2

I am

相关标签:
9条回答
  • 2020-12-03 09:38
    pip install opencv-python
    

    This solved the error for me in MacOS.

    0 讨论(0)
  • 2020-12-03 09:39

    It is because of opencv library. Try running this command in anaconda prompt:

    conda install -c conda-forge opencv
    
    0 讨论(0)
  • 2020-12-03 09:42

    Is your python path looking in the right place? Check where python is looking for the module. Within the notebook try:

    import os
    os.sys.path
    

    Is the cv2 module located in any of those directories? If not your path is looking in the wrong place. If it is overlooking the install location, append it to your python path. You can follow the instructions here.

    0 讨论(0)
提交回复
热议问题