kagb
kagb

Reputation: 636

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.

Upvotes: 5

Views: 16612

Answers (3)

Barathi Ganesh HB
Barathi Ganesh HB

Reputation: 111

Use the following:

sudo apt-get install libpng16-16

Upvotes: 6

Celia
Celia

Reputation: 1

I have meet the same problem with you. Maybe you can try copy libpng16.so.16 to /usr/lib64/. It works for me

Upvotes: 0

klion26
klion26

Reputation: 71

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

Upvotes: 5

Related Questions