So, here I was trying my hands on ipython notebook, when the following commands generated an error.
import matplotlib.pyplot as plt
import numpy as np
At first I thought it was due to some configuration issues with my notebook but when I tried the above commands on python via terminal, the same error surfaced.
ImportError: libpng15.so.15: cannot open shared object file: No such file or directory
It looked like either some files were missing or the interpreter was looking for them somewhere else.
Following the solutions on Stackoverflow-
Check the value of LD_LIBRARAY_PATH, do:
As expected, it returned an empty string, which meant I had to change its value.
Change the value of LD_LIBRARAY_PATH,do:
In my case it was /home/sarah/anaconda/lib, you can check for yours using
The solution did not work for me, in fact it is a temporary one, once the system is switched off, the exported path would be lost. You can make it permanent by adding the above line at the end of your .bashrc file and then running:
Caution! appending the above lines to my .bashrc, rendered useless running my text editors from the terminal,
So I had to redo the changes. Looked like things were real bad.
I had two more option before me, to either install/reinstall the libpng from package manager or do it manually.
sudo apt-get install zlib1g-dev
sudo apt-get install libpng-dev
sudo apt-get update
With hopes that my system will resolve the missing links, now that it had been updated. But, it did not, because the package manager still used the libping12 while I needed libpng15.
Left will no other option,here is what finally worked:
D/w the latest tar of libpng
Un-tar it and move inside the folder
sudo make install
sudo ln -s /usr/local/lib/libpng15.so /usr/lib
sudo ln -s /usr/local/lib/libpng15.so.15 /usr/ib
$ subl (opened without error)
>>import matplotlib.pyplot as plt