Ahh, that makes sense.  It is the sympy.python thing that causes the
problem.  This hack seems to work fix the issue in the notebook:

import sympy
sympy.sage_python = sympy.python
del sympy.python
from sympy import *

But any code in sympy that uses sympy.python will now fail.  Really
this is a bug in sage though.

Brian

On Tue, Apr 7, 2009 at 12:04 PM, Ondrej Certik <ond...@certik.cz> wrote:
>
> On Tue, Apr 7, 2009 at 11:01 AM, Brian Granger <ellisonbg....@gmail.com> 
> wrote:
>>
>> Hi,
>>
>> I am using the sage 3.2.3 notebook.  I am using it in python mode and
>> am having trouble with sympy:
>>
>> from sympy import *
>> x = var('x')
>>
>> Traceback (most recent call last):
>>  File "<stdin>", line 1, in <module>
>>  File "/Users/bgranger/.sage/sage_notebook/worksheets/admin/1/code/9.py",
>> line 6, in <module>
>>    print _support_.syseval(python, ur'''x = var(\u0027x\u0027)''',
>> '/Users/bgranger/.sage/sage_notebook/worksheets/admin/1/cells/3')
>>  File 
>> "/Users/bgranger/Documents/Computation/Sage/sage/local/lib/python2.5/site-packages/sage/server/support.py",
>> line 321, in syseval
>>    return system.eval(cmd, sage_globals, locals = sage_globals)
>> AttributeError: 'function' object has no attribute 'eval'
>>
>> This works fine in regular python and IPython and looks to be a
>> problem with the notebook.  Thoughts?  Should I try the latest
>> release?
>
> It's explained in this thread:
>
> http://groups.google.com/group/sage-devel/browse_thread/thread/25405a412cca6924/
>
> sage notebook doesn't work if you define a function with a name "python".
>
> What I don't know if it's a bug in the notebook, or if python packages
> should never use such a name for a function.
>
> Ondrej
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to