简体   繁体   中英

How to import openCV on Jupyter notebook?

The problem: When I command import cv2 on Jupyter notebook I get a ModuleNotFoundError: "No module named 'cv2'".

What I have tried: On Anaconda I wrote py -m pip install opencv-python and also conda install opencv as suggested in this question. I also tried the command pip install opencv-python as explained in step 2 in this manual. But every time I got the same error (on Jupyter notebook).

I would like for help, thank you.

Install a pip package in the current Jupyter kernel

I've run into similar issues and this article helped me out. You can try installing it from within the Jupyter Notbeook Kernel.

import sys
!{sys.executable} -m pip install opencv-python

Article I reference

try pip3 install opencv-python

also try pip3 install opencv-python== to see all the available versions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM