| Download
Replacing the default pexpect module with the a newer version that supports unicode.
Project: FriCAS Complex Analysis
Views: 64###Replacing the default pexpect module with the a newer version that supports unicode. http://trac.sagemath.org/ticket/10295
####To use a newer version of pexpect (or other module) in a Sage worksheet install the module in some directory using pip or other means:
Add the new directory to the interpreter's module search path.
If you are replacing an existing module you must force a reload of that module and any of its dependent modules.
<module 'pexpect' from '/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/lib/python2.7/site-packages/pexpect/__init__.pyc'>
'3.3'
<module 'expect' from './expect.pyc'>
<module 'sage.interfaces.axiom' from '/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/axiom.pyc'>
<module 'sage.interfaces.fricas' from '/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/fricas.pyc'>
Now FriCAS mode supports unicode variable names.
β + α
Type: Polynomial(Integer)
α
-
β
But Sage itself still does not support unicode variable names.
Error in lines 1-1
Traceback (most recent call last):
File "/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/.sagemathcloud/sage_server.py", line 879, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 1, in <module>
File "/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/.sagemathcloud/sage_salvus.py", line 2736, in var
return var0(*args, **kwds)
File "/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/.sagemathcloud/sage_salvus.py", line 2698, in var0
v = sage.all.SR.var(name, **kwds)
File "sage/symbolic/ring.pyx", line 595, in sage.symbolic.ring.SymbolicRing.var (build/cythonized/sage/symbolic/ring.cpp:8473)
cpdef var(self, name, latex_name=None, domain=None):
File "sage/symbolic/ring.pyx", line 648, in sage.symbolic.ring.SymbolicRing.var (build/cythonized/sage/symbolic/ring.cpp:8147)
raise ValueError('The name "'+s+'" is not a valid Python identifier.')
ValueError: The name "α" is not a valid Python identifier.
Error in lines 1-1
Traceback (most recent call last):
File "/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/.sagemathcloud/sage_server.py", line 879, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 1, in <module>
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 869, in sage
return self._sage_()
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/axiom.py", line 883, in _sage_
R = PolynomialRing(base_ring, vars)
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 472, in PolynomialRing
R = _multi_variate(base_ring, names, n, sparse, order, implementation)
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 564, in _multi_variate
names = normalize_names(n, names)
File "sage/structure/parent_gens.pyx", line 207, in sage.structure.parent_gens.normalize_names (build/cythonized/sage/structure/parent_gens.c:2797)
names = _certify_names(names)
File "sage/structure/parent_gens.pyx", line 146, in sage.structure.parent_gens._certify_names (build/cythonized/sage/structure/parent_gens.c:2245)
raise ValueError, "variable names must be alphanumeric, but one is '%s' which is not."%N
ValueError: variable names must be alphanumeric, but one is 'β' which is not.
<module 'sage.interfaces.gap' from '/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/gap.pyc'>
2
Error in lines 1-1
Traceback (most recent call last):
File "/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/.sagemathcloud/sage_server.py", line 879, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 1, in <module>
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/gap.py", line 1303, in set
out = self._eval_line(cmd, allow_use_file=True)
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/gap.py", line 769, in _eval_line
raise RuntimeError(message)
RuntimeError: Gap produced error output
Syntax error: expression expected
α:=2;;
^
executing α:=2;;
<module 'sage.interfaces.singular' from '/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/singular.pyc'>
2
// characteristic : 0
// number of vars : 2
// block 1 : ordering dp
// : names x y
// block 2 : ordering C
9*x^16-18*x^13*y^2
// characteristic : 0
// number of vars : 2
// block 1 : ordering dp
// : names N1 N2
// block 2 : ordering C
Error in lines 1-1
Traceback (most recent call last):
File "/projects/4bc39013-7b65-4a65-9d3d-bec4a4ce4d5a/.sagemathcloud/sage_server.py", line 879, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 1, in <module>
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/singular.py", line 729, in __call__
return SingularElement(self, type, x, False)
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/singular.py", line 1189, in __init__
self._name = parent._create( value, type)
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/singular.py", line 690, in _create
self.set(type, name, value)
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/singular.py", line 633, in set
self.eval(cmd)
File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/interfaces/singular.py", line 590, in eval
raise SingularError('Singular error:\n%s'%s)
TypeError: Singular error:
? error occurred in or before STDIN line 23: `if(defined(sage9)){kill sage9;};def sage11=9N116 - 18N113N22;`
Apparently Maxima does not properly display unicode but otherwise does not complain.
\±/\²
2
\±+1
[1] "X1" "Y2" "X3" "Y4" "X5" "Y6" "X7" "Y8" "X9" "Y10"
[1] "α1" "β2" "α3" "β4" "α5" "β6" "α7" "β8" "α9" "β10"
Error in lines 1-1
''
https://github.com/sagemath/cloud/wiki/FAQ
Remeber to add a note to FAQ
Remeber to add a note to FAQ