econchick / new-coder

New Coder tutorials
zlib License
597 stars 392 forks source link

dataviz Part 2 on Linux Mint #204

Closed matthewboman closed 8 years ago

matthewboman commented 8 years ago

I tried running the program and got this error:

Traceback (most recent call last): File "graph.py", line 4, in import matplotlib.pyplot as plt File "/home/crash/TestEnv/venv/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 29, in import matplotlib.colorbar File "/home/crash/TestEnv/venv/local/lib/python2.7/site-packages/matplotlib/colorbar.py", line 34, in import matplotlib.collections as collections File "/home/crash/TestEnv/venv/local/lib/python2.7/site-packages/matplotlib/collections.py", line 27, in import matplotlib.backend_bases as backend_bases File "/home/crash/TestEnv/venv/local/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 62, in import matplotlib.textpath as textpath File "/home/crash/TestEnv/venv/local/lib/python2.7/site-packages/matplotlib/textpath.py", line 18, in from matplotlib.mathtext import MathTextParser File "/home/crash/TestEnv/venv/local/lib/python2.7/site-packages/matplotlib/mathtext.py", line 60, in import matplotlib._png as _png ImportError: libpng16.so.16: cannot open shared object file: No such file or directory

matthewboman commented 8 years ago

I found a fix if anyone else is having this issue. It looks like some linux systems put it in a different place but this does the trick:

sudo cp /usr/local/lib/libpng16.so.16 /usr/lib

merwok commented 8 years ago

The /usr hierarchy is supposed to be under the control of the package manager (i.e. dpkg/apt), and /usr/local is for the local admin to do whatever they want. It looks like your libpng installation was not standard, which is very surprising (any web browser or image viewer should install libpng!). If other people see the same problem, further diagnosis would be needed. Manually putting stuff under /usr is a recipe for trouble!