mathplot lib not loading in Spyder.

289 views
Skip to first unread message

Stanley Rosenbaum

unread,
Jun 23, 2015, 9:13:28 AM6/23/15
to spyd...@googlegroups.com

I am running Spyder on a Mac.

After the updates this morning in Anaconda, I can't get my Spyder scripts to run.

I get a mathplotlib import error.


  File "//anaconda/lib/python3.4/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 682, in runfile
    execfile(filename, namespace)

  File "//anaconda/lib/python3.4/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 85, in execfile
    exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)

  File "/Users/srose3/Dropbox/SPYDER/SatPlanar/PLANAR.py", line 6, in <module>
    import matplotlib.pyplot as plt

  File "//anaconda/lib/python3.4/site-packages/matplotlib/pyplot.py", line 27, in <module>
    import matplotlib.colorbar

  File "//anaconda/lib/python3.4/site-packages/matplotlib/colorbar.py", line 34, in <module>
    import matplotlib.collections as collections

  File "//anaconda/lib/python3.4/site-packages/matplotlib/collections.py", line 27, in <module>
    import matplotlib.backend_bases as backend_bases

  File "//anaconda/lib/python3.4/site-packages/matplotlib/backend_bases.py", line 56, in <module>
    import matplotlib.textpath as textpath

  File "//anaconda/lib/python3.4/site-packages/matplotlib/textpath.py", line 22, in <module>
    from matplotlib.mathtext import MathTextParser

  File "//anaconda/lib/python3.4/site-packages/matplotlib/mathtext.py", line 63, in <module>
    import matplotlib._png as _png

ImportError: dlopen(//anaconda/lib/python3.4/site-packages/matplotlib/_png.so, 2): Library not loaded: @loader_path/../../../libpng15.15.dylib
  Referenced from: //anaconda/lib/python3.4/site-packages/matplotlib/_png.so
  Reason: image not found

Any suggestion how to get around this?

Thank

Adrian Klaver

unread,
Jun 23, 2015, 9:15:41 AM6/23/15
to spyd...@googlegroups.com
On 06/23/2015 06:12 AM, Stanley Rosenbaum wrote:
>
> I am running Spyder on a Mac.
>
> After the updates this morning in Anaconda, I can't get my Spyder
> scripts to run.

What did you update?


Did you see this?:

https://groups.google.com/forum/#!topic/spyderlib/pDnWTDA3q50
--
Adrian Klaver
adrian...@aklaver.com

Carlos Córdoba

unread,
Jun 23, 2015, 9:16:33 AM6/23/15
to spyd...@googlegroups.com
Hi,

Please run

    conda update qt

to fix this problem. I also want to mention that the current Anaconda's Spyder is failing in Mac for a different reason, but that will be fixed during the day :-)

Cheers,
Carlos

El 23/06/15 a las 08:12, Stanley Rosenbaum escribió:
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Emily Moravec

unread,
Jun 29, 2015, 1:55:49 PM6/29/15
to spyd...@googlegroups.com
Hello, I just reinstalled and updated my anaconda about an hour ago and am trying to run my python scripts in Spyder on a Mac. I had the same problem as Stanley Rosenbaum and tried Carlos Córdoba's fix. However, I am still getting the same error (see below) in Spyder (and also can't get matplotlib to load in python at all actually). Was this problem ever fixed?

runfile('/Users/Emily/Documents/Research/Masters_Thesis/All_spectra/plot_hst_mdm_090924.py', wdir='/Users/Emily/Documents/Research/Masters_Thesis/All_spectra')
Traceback (most recent call last):

  File "<ipython-input-1-e715d239a6bf>", line 1, in <module>
    runfile('/Users/Emily/Documents/Research/Masters_Thesis/All_spectra/plot_hst_mdm_090924.py', wdir='/Users/Emily/Documents/Research/Masters_Thesis/All_spectra')

  File "/Users/Emily/anaconda/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 685, in runfile
    execfile(filename, namespace)

  File "/Users/Emily/anaconda/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 78, in execfile
    builtins.execfile(filename, *where)

  File "/Users/Emily/Documents/Research/Masters_Thesis/All_spectra/plot_hst_mdm_090924.py", line 9, in <module>
    import pylab as pl

  File "/Users/Emily/anaconda/lib/python2.7/site-packages/pylab.py", line 1, in <module>
    from matplotlib.pylab import *

  File "/Users/Emily/anaconda/lib/python2.7/site-packages/matplotlib/pylab.py", line 231, in <module>
    import matplotlib.finance

  File "/Users/Emily/anaconda/lib/python2.7/site-packages/matplotlib/finance.py", line 38, in <module>
    from matplotlib.collections import LineCollection, PolyCollection

  File "/Users/Emily/anaconda/lib/python2.7/site-packages/matplotlib/collections.py", line 27, in <module>
    import matplotlib.backend_bases as backend_bases

  File "/Users/Emily/anaconda/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 56, in <module>
    import matplotlib.textpath as textpath

  File "/Users/Emily/anaconda/lib/python2.7/site-packages/matplotlib/textpath.py", line 22, in <module>
    from matplotlib.mathtext import MathTextParser

  File "/Users/Emily/anaconda/lib/python2.7/site-packages/matplotlib/mathtext.py", line 63, in <module>
    import matplotlib._png as _png

ImportError: dlopen(/Users/Emily/anaconda/lib/python2.7/site-packages/matplotlib/_png.so, 2): Library not loaded: @loader_path/../../../libpng15.15.dylib
  Referenced from: /Users/Emily/anaconda/lib/python2.7/site-packages/matplotlib/_png.so
  Reason: image not found

Carlos Córdoba

unread,
Jun 29, 2015, 1:57:49 PM6/29/15
to spyd...@googlegroups.com
Yes, the problem is fixed.

You need to run

    conda update qt
    conda update matplotlib

to get the solution.

Cheers,
Carlos

El 29/06/15 a las 11:32, Emily Moravec escribió:

Emily Moravec

unread,
Jun 29, 2015, 2:03:38 PM6/29/15
to spyd...@googlegroups.com
Thank you.
You received this message because you are subscribed to a topic in the Google Groups "spyder" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/spyderlib/dbhXA-GedGE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to spyderlib+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages