OpenCV in Ubuntu 17.04
Solution 1
I found the answer here: https://github.com/opencv/opencv/issues/8622
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev
References to 17.04 packages no longer work.
Solution 2
Installing the opencv
library from the repository worked for me.
Just both the following commands.
sudo apt-get install opencv-data
sudo apt-get install libopencv-dev
After installing that it worked as before. Previously I had build opencv
myself. The one from the repository will work apparantely.
Solution 3
libjasper-dev is not available for Ubuntu 17.04.
So you need to install the package from an earlier release. Try the following:
echo "deb http://us.archive.ubuntu.com/ubuntu/ yakkety universe" | sudo tee -a /etc/apt/sources.list
This will add a new line to the sources.list file in /etc/apt. It will allow installation of packages from 16.10.
You should be able to install the missing package libjasper-dev now with the following commands:
sudo apt-get update
sudo apt-get install libjasper-dev
Related videos on Youtube
mjm
Updated on May 23, 2020Comments
-
mjm about 4 years
I had
OpenCV
installed in myUbuntu
machine runningUbuntu 16.10
. Recently I updated to the latestUbuntu 17.04
andOpenCV
failed to work.I am getting the following error.
ImportError: libjasper.so.1: cannot open shared object file: No such file or directory
I tried to install
libjasper
. With the commandsudo apt-get install libjasper-dev
But I am getting the error
E: Unable to locate package libjasper-dev
How can I fix it ?
-
eyllanesc about 7 yearsYou could look up the package name with:
apt-cache search libjasper
orapt-cache search jasper
-
mjm about 7 years@eyllanesc The package doesnt seems to be available for Ubuntu 17.04. Please check this link. packages.ubuntu.com/search?keywords=libjasper-dev
-
-
Antonio about 7 yearsRebuilding your opencv disabling jpeg2000 support would work as well. Building opencv is usually the most powerful way of installing it, see stackoverflow.com/questions/26592577/… (votes strongly converged to the "build it yourself" version)
-
Ofer Sadan almost 7 yearstnx for this answer!
-
Shameerariff almost 7 yearsHaving the dependencies issues in version 17.xx, still a good try
-
gkhaos about 6 yearsaffirmed on lubuntu 17.10
-
Admin almost 6 yearsThis did not work on Ubuntu 18.04. The below answer does, however.
-
sirop over 5 yearssudo add-apt-repository "deb security.ubuntu.com/ubuntu xenial-security main" ; sudo apt update ; sudo apt install libjasper1 libjasper-dev works on Ubuntu 18.04
-
A.Ametov about 5 yearsMalformed entry 54 in list file /etc/apt/sources.list (URI parse) after @sirop command performed
-
sirop about 5 yearsTry it with single quotes:
sudo add-apt-repository 'deb http://security.ubuntu.com/ubuntu xenial-security main'
or manually edit /etc/apt/sources.list . -
dolgom almost 5 years'us.archive.ubuntu.com' should be 'old-releases.ubuntu.com'
-
dolgom almost 5 yearsnot worked in Ubuntu 18.04 for me. I got 404 Not Found error for security.ubuntu.com/ubuntu xenial-security/main arm64 Packages
-
Bms bharadwaj almost 5 yearsawesome :D. worked for me as well, after struggling for 2 hrs with other methods.
-
Chau Giang over 4 yearsworked in 18.04 for me when I tried to install opencv
-
gone over 4 years
Ign:9 http://security.ubuntu.com/ubuntu xenial-security/main arm64 Packages
Ign:9 http://security.ubuntu.com/ubuntu xenial-security/main arm64 Packages
Err:9 http://security.ubuntu.com/ubuntu xenial-security/main arm64 Packages
404 Not Found [IP: 91.189.91.26 80]
-
cagri over 3 yearsis there any really working solution for this?