Thank you for the response, kcrisman (sorry I don’t know your first name).

Configuration: Apple MacBook pro running OSX 10.9.3
Downloaded and installed vanilla sage-6.2-x86_64-Darwin-OSX_10.9_x86_64.dmg
I have set export SAGE_MATPLOTLIB_GUI=no in my .bash_profile (due to a similar 
situation in the past. I only want to use matplotlib to save to .png files, not 
to view interactively.) I am happy with Sage being built without tkagg support.
(I also have python, scipy, matplotlib, etc. installed via macports, but Sage 
has always worked as a stand-alone environment, which pleases me. I work in the 
two environments independently. macports stuff is up-to-date.)

Has anyone else experienced this problem? The test is exceedingly simple:
sage: import matplotlib.pyplot as plt

I actually found the same reports you suggest via Google before submitting this 
question to sage-support.
What I have attempted:

1. Acting on 
http://ask.sagemath.org/question/626/sage-python-import-matplotlib-no-module-named,
 I edited 
/Applications/sage/local/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-macosx-10.9-x86_64.egg/matplotlib/backends/tkagg.py
changed import _tkagg
to import backend_tkagg as _tkagg
which then caused the error
ImportError: cannot import name backend_tkagg

2. Acting on 
http://ask.sagemath.org/question/3962/gui-backend-matplotlib-in-sage, I rebuilt 
matplotlib via sage -f matplotlib
That failed, probably for the reason explained in that report, so I reinstalled 
vanilla Sage 6.2

If I am the only person experiencing this problem, then it must be something in 
my configuration,
but I’d really like to know if this is a problem in the Sage 6.2 distribution, 
so it can get fixed.

Thanks to all,
Jim

On May 27, 2014, at 9:33 AM, kcrisman <kcris...@gmail.com> wrote:

> Hi!  Is it possible that some locations changed in your installation?  Here 
> is an old post that has a very similar error:
> https://groups.google.com/forum/#!topic/sage-support/fV2VNL-5UuY
> 
> Otherwise, perhaps the problem may be the one described here:
> http://ask.sagemath.org/question/626/sage-python-import-matplotlib-no-module-named
> in which case the binary was probably compiled without tkagg support, which 
> is normal.  You could Compile Sage from scratch, perhaps could redo 
> matplotlib.  See also 
> http://ask.sagemath.org/question/3962/gui-backend-matplotlib-in-sage
> 
> Now, we did upgrade matplotlib in http://trac.sagemath.org/ticket/14993 so I 
> wouldn't be surprised if that did cause some problems (there were several 
> tickets fixed) but it is a little surprising that this is the one, since we 
> have this same line in the documentation at 
> http://www.sagemath.org/doc/reference/plotting/sage/plot/plot.html#sage.plot.plot.SelectiveFormatter
> 
> I hope that ONE of these things helps, but I'm sorry if not - in that event, 
> any other platform details would be very helpful for us.
> 
> On Tuesday, May 27, 2014 7:04:08 AM UTC-4, Jim wrote:
> Hello,
> 
> A script that I wrote in April under Sage 6.1.1 stopped working; attempting 
> to import matplotlib.pyplot produces an error:
> 
> Jims-computer:HW2 jim$ sage
> ┌────────────────────────────────────────────────────────────────────┐
> │ Sage Version 6.2, Release Date: 2014-05-06                         │
> │ Type "notebook()" for the browser-based notebook interface.        │
> │ Type "help()" for help.                                            │
> └────────────────────────────────────────────────────────────────────┘
> sage: import matplotlib.pyplot as mpl
> ---------------------------------------------------------------------------
> ImportError                               Traceback (most recent call last)
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to