Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError:libpng16.so.16 cannot open shared object file

After installing matplotlib successfully on my Fedora19,I tested my code written by python. Unfortunately,I got this ImportError .

$ python ren.py 

Traceback (most recent call last):

  File "ren.py", line 10, in <module>
    import matplotlib.pyplot as plt

  File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 26, in <module>
    from matplotlib.figure import Figure, figaspect

  File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 32, in <module>
    from matplotlib.image import FigureImage

  File "/usr/lib64/python2.7/site-packages/matplotlib/image.py", line 22, in <module>
    import matplotlib._png as _png

ImportError: libpng16.so.16: cannot open shared object file: No such file or directory

I have found the file "libpng16.so.16" and copied it to /usr/lib. But nothing happened. Any help will be appreciated.

like image 460
kagb Avatar asked Sep 13 '13 07:09

kagb


2 Answers

copy libpng16.so.16 to /usr/lib/ may be ok. in my computer(Fedora 19), libpng16.so.16 can be found in /usr/local/lib

like image 174
klion26 Avatar answered Nov 19 '22 15:11

klion26


Use the following:

sudo apt-get install libpng16-16
like image 45
Barathi Ganesh HB Avatar answered Nov 19 '22 16:11

Barathi Ganesh HB