python - Errors with matplotlib, what am I missing? -
i've been experimenting spy (spectral python), using pycharm on mac. i've been running error after error, stands, error i'm stumped on:
program output:
/system/library/frameworks/python.framework/versions/2.7/bin/python2.7 "/users/pkillam/pycharmprojects/untitled/spy experiments" /library/python/2.7/site-packages/spectral/spectral.py:198: userwarning: unable import or configure pylab plotter. spectrum plots unavailable. 'will unavailable.', userwarning) . . #normal output . traceback (most recent call last): file "/users/pkillam/pycharmprojects/untitled/spy experiments", line 28, in <module> view = imshow(img, (29, 19, 9)) file "/library/python/2.7/site-packages/spectral/graphics/spypylab.py", line 1238, in imshow import matplotlib.pyplot plt file "/library/python/2.7/site-packages/matplotlib/pyplot.py", line 34, in <module> matplotlib.figure import figure, figaspect file "/library/python/2.7/site-packages/matplotlib/figure.py", line 40, in <module> matplotlib.axes import axes, subplotbase, subplot_class_factory file "/library/python/2.7/site-packages/matplotlib/axes/__init__.py", line 4, in <module> ._subplots import * file "/library/python/2.7/site-packages/matplotlib/axes/_subplots.py", line 10, in <module> matplotlib.axes._axes import axes file "/library/python/2.7/site-packages/matplotlib/axes/_axes.py", line 21, in <module> import matplotlib.dates _ # <-registers date unit converter file "/library/python/2.7/site-packages/matplotlib/dates.py", line 126, in <module> dateutil.rrule import (rrule, mo, tu, we, th, fr, sa, su, yearly, file "/library/python/2.7/site-packages/dateutil/rrule.py", line 16, in <module> six.moves import _thread importerror: cannot import name _thread process finished exit code 1
and here code, spy guide found here: http://www.spectralpython.net/user_guide.html
import matplotlib matplotlib.use('wx') spectral import * img = open_image('92av3c.lan') print img.__class__ print print img print print img.shape pixel = img[50,100] print print pixel.shape band6 = img[:,:,5] print print band6.shape print arr = img.load() print arr.__class__ print print arr.info() print print arr.shape view = imshow(img, (29, 19, 9))
any ideas?
alright, fixed problem. turns out pycharm trying access 2 different versions of matplotlib ever since updated using own package manager. fixed removing 1 of versions, however, later on continued running problem after problem.
this code works though, because moved on anaconda's spyder instead of pycharm, has been much, easier work with!
thank you, helped in comments.
Comments
Post a Comment