ImportError: no module named 'cv2' Python3

I have such a problem

(face_det) user@pc:~$ python3
Python 3.5.3 (default, Apr 22 2017, 00:00:00) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'cv2

I don't have it on python2:

(face_det) user@pc:~$ python2
Python 2.7.13 |Anaconda custom (64-bit)| (default, Dec 20 2016, 23:09:15) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import cv2
>>> 

Despite the fact that I have opencv (I also tried uninstalling it and installing it later):

(face_det) user@pc:~$ pip3 install opencv
Requirement already satisfied: opencv in ./.virtualenvs/face_det/lib/python3.5/site-packages
(face_det) user@pc:~$ conda install opencv
Fetching package metadata .........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at /home/pc/anaconda3:
#
opencv                    3.2.0               np112py27_0    conda-forge
+8
source share
5 answers

Try

pip3 install opencv-python

to get cv2. I'm not sure when it opencv-pythonbecame available. I built opencv manually, but when I looked a few weeks ago, it was like that. I use cv2with Python3 in a VM that works ubuntu/trusty64.

+18
source

I think you're on Linux, judging by pc:~$

Try setting the following link:

http://docs.opencv.org/3.0-beta/doc/tutorials/introduction/linux_install/linux_install.html

, , !

0

conda openCV python2.7. opencv, pip3, face_det. , , python3 .

source activate face_det
python3
import cv2
0

sudo python3.5 -m pip install opencv-python

0

. PyCharm. , Python.

python (, python3, python36, python anaconda3 ). PyCharm, ( File-> -> : xxxx → ), , anaconda3.

pip opencv-python python36. , python, python36 .

Anaconda3, anaconda3 pip install opencv-pithon .

0

All Articles