5

I want to use opencv under python 3 in Ubunto 14.04. I plan to use the PyCharm IDE to develop my program.

Inside PyCharm I choose, I set:

File/Settings/Project:HelloWorld/Project Interpreter/3.4.3(/usr/bin/python3.4)

Python 3.4.3 is the default version of python in Ubunto 14.04.

Then I try to add opencv-python package:

File/Settings/Project:HelloWorld/Project Interpreter/+ (where you add the package)

and the system gives me this error:

 Executed command:

 pip install opencv-python 


 Try to run this command from the system terminal. Make sure that you   
 use the correct version of 'pip' installed for your Python interpreter located at '/usr/bin/python3.4'.

 DEPRECATION: --no-install, --no-download, --build, and --no-clean are   deprecated.  See https://github.com/pypa/pip/issues/906.
 Downloading/unpacking opencv-python
 Could not find any downloads that satisfy the requirement opencv-python
 Cleaning up...
 No distributions at all found for opencv-python
 Storing debug log for failure in /root/.pip/pip.log

the error is the same when I run the command from terminal. I believe the problem is related to installing opencv under python3 but I am not sure I know if I can fix it. Please let me know your opinion.

Thanks

Davide
  • 1,931
  • 2
  • 19
  • 39
yas yasi
  • 215
  • 1
  • 6
  • 16

4 Answers4

9

The fix is to update your pip and try again. This worked for me.

So, first:

pip install --upgrade pip

after that:

pip install opencv-python

Joseph
  • 2,327
  • 1
  • 19
  • 21
1

First, you should not use install opencv-python, this is not the official opencv package. Please, see: **SOLVED** How to include libgtk2.0-dev and pkg-config in cmake when installing openCV on Ubuntu 16

If you want to install opencv, you can follow this website, that worked for me. You might need to apapt some parts (mainly version numbers, and paths during the cmake process).

Community
  • 1
  • 1
daniel_hck
  • 1,100
  • 3
  • 19
  • 38
1

I also faced similar issue in the windows and pip upgrade worked for me,

pip install --upgrade pip

and install using below command,

pip install opencv-python
Maliq
  • 315
  • 1
  • 3
  • 11
0

As far as I can see from querying pip (using pip search opencv) there is no package called opencv-python I think the one you're looking for is pyopencv.

this issue appears to be almost identical

Community
  • 1
  • 1
Dillanm
  • 876
  • 12
  • 28
  • I could solve the problem following this: http://cyaninfinite.com/tutorials/installing-opencv-in-ubuntu-for-python-3/. No, I have another problem (seems some libraries are missing). Here is the error: `OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config,`. – yas yasi Sep 19 '16 at 10:48
  • (I don't mean this to sound like I'm being sarcastic) Have you tried installing the missing libraries? – Dillanm Sep 19 '16 at 13:23
  • 1
    I followed this instruction: http://stackoverflow.com/questions/28776053/opencv-gtk2-x-error and it worked. Dilanm, yes I tried but going through the `make` and `install` phase, is not an easy task always. My problem is now solved – yas yasi Sep 19 '16 at 13:48