1
votes

I am attempting to install OpenCV on my linux computerI followed this installation guide:

Linux / Mac Users:

pip3 install numpy or apt-get install python3-numpy. You may need to apt-get install python3-pip.

pip3 install matplotlib or apt-get install python3-matplotlib.

apt-get install python-OpenCV.

...

everything installs, except the last one Python-OpenCV error:

  E: unable to locate package python-OpenCV

and then when I run python in the terminal and try to run:

 import matplotlab

I get the error

Traceback (most recent call last):
   file "stdin>", line 1, in <module>
Importerror: no module named 'matlabplot'

meanwhile

import cv2 

&

import numpy

run without error and seem to work, this is also the case when I run a .py file that calls for importing those three.

Any information will be helpful, i am fairly new to python and linux :)

2
For one, you probably want to import matplotlibnot matlabplot or matplotlab - marcman
In Linux mint, the package name is all lower case - apt-get install python-opencv so yours might be too. (Generally Linux is very fussy about the case of every command - always a gotcha for people new to Linux). - GregHNZ
did you mean matplotlib.org ? - Haha TTpro

2 Answers

0
votes

Use Anaconda, there are download for Windows, Linux and Mac. Installation is easy.

I would suggest you download Anaconda2. Then install with command (on Linux) (more documentation on installation)

bash ~/Downloads/Anaconda2-4.4.0-Linux-x86_64.sh

There are cv2, mathplotlib pre-install

pic

*NOTE: I trying to find mathplotlab or matlabplot with Python on Google but can't find any. Instead, Google suggests mathplotlib. Perhaps you mistake library name

0
votes

The openCV 3 package is called opencv-python in pip3 (python3). For python2, replace pip3 with pip and python3-opencv with python-opencv

Mac OS (OS X) / Linux

$ pip3 install -U opencv-python

or as mentioned by @GregHNZ on linux

$ apt-get install python3-opencv

All versions are imported with import cv2 inside python scripts.


Probably you can import cv2and numpybecause it is installed for dependency reasons by other packages.
As in comments already mentioned probably you mean matplotlib