Ask Your Question

Airton Granero's profile - activity

2019-05-26 07:28:59 -0600 received badge  Notable Question (source)
2018-05-02 17:20:31 -0600 received badge  Self-Learner (source)
2018-05-02 17:20:31 -0600 received badge  Teacher (source)
2018-05-02 17:20:14 -0600 received badge  Nice Question (source)
2017-08-28 11:33:39 -0600 received badge  Popular Question (source)
2016-08-18 16:04:14 -0600 answered a question Interact in standalone SageMath do not work as SageMathCell

If on the command line I call

 sage

and inside sage command line I do:

 notebook()

another web interface is opened on localhost:8080/admin/1 (Sage notebook) instead of localhost:8000/tree# (Jupyter notebook), now I have and in this web interface it works.

The default home page on this VM is the Jupyter Notebook and in this one it does not work, but on sage notbook it works.

But it only works locally, on the host machine this interface is inaccessible even if you publish the worksheet, that will put it at ipaddress:8080/home/pub/0 (on the local machine it works as localhost:8080/home/pub/0).

2016-08-18 15:28:15 -0600 commented question Interact in standalone SageMath do not work as SageMathCell

I had posted an update about that.

2016-08-17 17:44:57 -0600 received badge  Student (source)
2016-08-17 17:39:46 -0600 received badge  Editor (source)
2016-08-17 15:59:59 -0600 asked a question Interact in standalone SageMath do not work as SageMathCell

I downloaded SageMath VM for Windows from sagemath
If I try an interact example:

@interact
def _(n=slider(1,20, step_size=1)):
     print(factorial(n))

it does not work unless I do first:

     from sagenb.notebook.interact import *

what is nowhere in the documentation by the way. Even so, I need to call the function first (what in SageMathCell is not needed):

     _()

I get the error:

TypeError
Traceback (most recent call last) <ipython-input-65-02a00410cc9d> in <module>() ----> 1 _()

<ipython-input-64-067de41a741b> in _(n) 1 @interact 2 def _(n=slider(Integer(1),Integer(20), step_size=Integer(1))): ----> 3 print(factorial(n))

/home/sage/sage-7.2/src/sage/symbolic/function.pyx in sage.symbolic.function.GinacFunction.__call__ (/home/sage/sage-7.2/src/build/cythonized/sage/symbolic/function.cpp:9536)() 819 (0, Integer Ring) 820 """ --> 821 res = super(GinacFunction, self).__call__(args, *kwds) 822 823 # Convert to Integer if the output was of type "int" and any of

/home/sage/sage-7.2/src/sage/symbolic/function.pyx in sage.symbolic.function.BuiltinFunction.__call__ (/home/sage/sage-7.2/src/build/cythonized/sage/symbolic/function.cpp:11161)() 970 res = self._evalf_try_(*args) 971 if res is None: --> 972 res = super(BuiltinFunction, self).__call__( 973 *args, coerce=coerce, hold=hold) 974

/home/sage/sage-7.2/src/sage/symbolic/function.pyx in sage.symbolic.function.Function.__call__ (/home/sage/sage-7.2/src/build/cythonized/sage/symbolic/function.cpp:6754)() 469 if callable(method): 470 return method() --> 471 raise TypeError("cannot coerce arguments: %s" % (err)) 472 473 else: # coerce == False

TypeError: cannot coerce arguments: no canonical coercion from <type 'instance'=""> to Symbolic Ring

But in SageMathCell it works.

If I change print(factorial(n)) for print(type(n)) when I call _() I get:

     <type 'instance'>

Again If I just call print(n) I get:

     Slider: None [1--|1|---20]

I understand that this means that n (the slider) is not a number. But again in SageMathCell it works.

UPDATE:

I am using Sage-7.2-ova virtual machine image for Windows (a dedicated CentOS machine) (unfortunately I have no karma to post links) in a Windows 10 VM under VMware Workstation 12. Player.

The machine has an integrated Chromium browser, the VM is completely off the shelf, just open the OVA and the machine is running. The only configs I did were: * for the keyboard (ABNT2 BR); * to access the web server from the host; * to install VMWare tools and get a shared folder with the host

but the error was there before all that.

And the error is not about the browser, the interpreter obviously do not accept the commands, the stack trace is very consistent about that, as the SageMathCell site (no links again because of my karma) was a different version (at least on the interact package).

IMPORTANT:

I am not using sage on command line. I am using on Sage Notebook on Jupyter via browser (not using aPython kernel, but Sage 7.2 kernel), by clicking New Notebook.

On command the line I have ... (more)