Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot import cv2 on PyCharm

I am trying to import cv2 module in PyCharm, but it shows error. I tried in terminal as well

pip install opencv-python
pip3 install cv2
pip install opencv-python
pip3 install cv2

and whatnot.

Trying to install opencv-python from terminal shows this

Requirement already satisfied: opencv-python in ./anaconda3/lib/python3.6/site-packages (3.4.1.15)

and trying to install cv2 from terminal shows this

Could not find a version that satisfies the requirement cv2 (from versions: )
No matching distribution found for cv2

However, trying to import cv2 on Pycharm shows this :

Pycharm Error Image

like image 328
thesamiroli Avatar asked Jun 30 '18 12:06

thesamiroli


1 Answers

First, install the package named opencv-python via pip install opencv-python or use the GUI.

Second, just input import cv2; that is ok.

like image 105
Jing Avatar answered Sep 20 '22 06:09

Jing