I had OpenCV
installed in my Ubuntu
machine running Ubuntu 16.10
. Recently I updated to the latest Ubuntu 17.04
and OpenCV
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 command sudo apt-get install libjasper-dev
But I am getting the error E: Unable to locate package libjasper-dev
How can I fix it ?
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With