Calysto / scilab_kernel

A Scilab Kernel for IPython
MIT License
58 stars 23 forks source link

Scilab kernel always timeout #13

Closed New1997 closed 5 years ago

New1997 commented 5 years ago

I can't use scilab with jupyter because it always timeout and won't execute the code

blink1073 commented 5 years ago

Hi @New1997, which operating system and which version of Scilab are you using?

New1997 commented 5 years ago

ubuntu 18.04 scilab 6.0.1 sorry for not being specific earlier

blink1073 commented 5 years ago

I am using a similar setup. Did you set the SCILAB_EXECUTABLE? I have export SCILAB_EXECUTABLE=~/scilab-6.0.2/bin/scilab-cli in my ~/.bashrc.

New1997 commented 5 years ago

i use export SCILAB_EXECUTABLE=/usr/bin/scilab-adv-cli but still the same, the kernel timeout

New1997 commented 5 years ago

whenever I start the kernel (open a notebook) I got this Timeout waiting for kernel_info reply after Kernel started

blink1073 commented 5 years ago

Let's try a low level approach, please launch python and try the following:

from scilab_kernel.kernel import ScilabKernel   
wrapper = ScilabKernel().makeWrapper() 
print(wrapper.run_command("ones('3')"))

On my machine that prints:

 ans  =

   1.
New1997 commented 5 years ago

I got No module named 'scilab_kernel'

blink1073 commented 5 years ago

Can you please do the following:

jupyter kernelspec list
cat <path_to_scilab_kernel>/kernel.json

And try with the python given in "argv"?

New1997 commented 5 years ago

same output and btw why it use python and not pytohn3?

blink1073 commented 5 years ago

What was the path in argv?

New1997 commented 5 years ago

what do you mean?

blink1073 commented 5 years ago

I meant what was the python path the kernel was expecting to use.

blink1073 commented 5 years ago

e.g. /home/silvester/miniconda3/bin/python

New1997 commented 5 years ago

/usr/local/share/jupyter/kernels/scilab/kernel.json this is the path by kernelspec this is the output of cat { "argv": ["python", "-m", "scilab_kernel", "-f", "{connection_file}"], "display_name": "Scilab", "language": "scilab", "mimetype": "text/x-octave", "name": "scilab" }

blink1073 commented 5 years ago

can you please give the contents of that file?

New1997 commented 5 years ago

any luck?

blink1073 commented 5 years ago

Please try jupyter kernelspec remove scilab and then pip install scilab_kernel, and then paste the contents of that file again.

New1997 commented 5 years ago

{ "argv": ["python", "-m", "scilab_kernel", "-f", "{connection_file}"], "display_name": "Scilab", "language": "scilab", "mimetype": "text/x-octave", "name": "scilab" } I got the same content

blink1073 commented 5 years ago

Does python -c "import scilab_kernel" work now?

New1997 commented 5 years ago

the thing is I can't even do from scilab_kernel.kernel import ScilabKernel in python

blink1073 commented 5 years ago

Okay, what is which python, which pip?

New1997 commented 5 years ago

first i install with pip3 but now i launch python 2.7 even python2.7 doesn't recognize

New1997 commented 5 years ago

no it is okay, I see, It use miniconda python instead of global python

blink1073 commented 5 years ago

It uses whichever is first in your $PATH

New1997 commented 5 years ago

how to fix it ? btw i tried from scilab_kernel.kernel import ScilabKernel wrapper = ScilabKernel().makeWrapper() print(wrapper.run_command("ones('3')"))

with python from /usr/bin (I kind of using it raw for test) and it got stuck at wrapper = ScilabKernel().makeWrapper()

edit: to use native python over miniconda python i use a dirty fix: just add \export PATH="/usr/bin:$PATH" at the end of .bashrc file (for those like me, who lost a bit between native python and miniconda python)

blink1073 commented 5 years ago

It just hangs?

New1997 commented 5 years ago

yes

blink1073 commented 5 years ago

Do you have a scilab startup file? https://help.scilab.org/docs/5.3.3/en_US/startup.html

New1997 commented 5 years ago

I will give you the output of ls .Scilab/scilab-6.0.1/

atoms 
history
scinotesConfiguration.xml
XConfiguration.xml
configuration.xml
palettes.xml
WindowsConfiguration.xml
xcos.xml
New1997 commented 5 years ago

so?

blink1073 commented 5 years ago

When you start scilab-cli from the command line, does it print --> as the prompt?

New1997 commented 5 years ago

No

$ scilab-cli
commons module not found.
graphic_objects module not found.
ui_data module not found.
graph module not found.
history_browser module not found.
slint module not found.
coverage module not found.
New1997 commented 5 years ago

and

$ scilab-adv-cli 
Picked up _JAVA_OPTIONS: -Djava.class.path=/usr/share/java/flexdock.jar:/usr/share/java/skinlf.jar:/usr/share/java/looks.jar:/usr/share/java/commons-logging.jar:/usr/share/java/jhall.jar:/usr/share/java/lucene-core-4.10.4.jar:/usr/share/java/lucene-analyzers-common-4.10.4.jar:/usr/share/java/lucene-queryparser-4.10.4.jar:/usr/share/maven-repo/org/freehep/freehep-util/debian/freehep-util-debian.jar:/usr/share/maven-repo/org/freehep/freehep-io/debian/freehep-io-debian.jar:/usr/share/maven-repo/org/freehep/freehep-graphicsio/debian/freehep-graphicsio-debian.jar:/usr/share/java/freehep-graphicsio-emf-2.1.jar:/usr/share/java/freehep-graphics2d-2.1.1.jar:/usr/share/java/jrosetta-API.jar:/usr/share/java/jrosetta-engine-1.0.4.jar:/usr/share/java/jgraphx.jar:/usr/share/java/jogl2.jar:/usr/share/java/gluegen2-rt.jar:/usr/share/java/jeuclid-core.jar:/usr/share/java/jlatexmath-fop-1.0.7.jar:/usr/share/java/fop.jar:/usr/share/java/saxon.jar:/usr/share/java/batik.jar:/usr/share/java/xml-apis-ext.jar:/usr/share/java/commons-io.jar:/usr/share/java/xmlgraphics-commons.jar:/usr/share/java/avalon-framework.jar:/usr/share/java/jlatexmath-1.0.7.jar:/usr/share/java/ecj.jar:/usr/share/java/javax.activation.jar:/usr/share/java/jaxb-runtime.jar:/usr/share/scilab/modules/commons/jar/org.scilab.modules.commons.jar:/usr/share/scilab/modules/gui/jar/org.scilab.modules.gui.jar:/usr/share/scilab/modules/xcos/jar/org.scilab.modules.xcos.jar:/usr/share/scilab/modules/history_browser/jar/org.scilab.modules.history_browser.jar:/usr/share/scilab/modules/ui_data/jar/org.scilab.modules.ui_data.jar:/usr/share/scilab/modules/external_objects_java/jar/org.scilab.modules.external_objects_java.jar:/usr/share/scilab/modules/jvm/jar/org.scilab.modules.jvm.jar:/usr/share/scilab/modules/preferences/jar/org.scilab.modules.preferences.jar:/usr/share/scilab/modules/core/jar/org.scilab.modules.core.jar:/usr/share/scilab/modules/scinotes/jar/org.scilab.modules.scinotes.jar:/usr/share/scilab/modules/graphic_export/jar/org.scilab.modules.graphic_export.jar:/usr/share/scilab/modules/types/jar/org.scilab.modules.types.jar:/usr/share/scilab/modules/scirenderer/jar/scirenderer.jar:/usr/share/scilab/modules/graphic_objects/jar/org.scilab.modules.graphic_objects.jar:/usr/share/scilab/modules/renderer/jar/org.scilab.modules.renderer.jar:/usr/share/scilab/modules/helptools/jar/org.scilab.modules.helptools.jar:/usr/share/scilab/modules/helptools/jar/scilab_images.jar:/usr/share/scilab/modules/helptools/jar/scilab_ru_RU_help.jar:/usr/share/scilab/modules/helptools/jar/scilab_en_US_help.jar:/usr/share/scilab/modules/localization/jar/org.scilab.modules.localization.jar:/usr/share/scilab/modules/console/jar/org.scilab.modules.console.jar:/usr/share/scilab/modules/completion/jar/org.scilab.modules.completion.jar:/usr/share/scilab/modules/action_binding/jar/org.scilab.modules.action_binding.jar:/usr/share/scilab/modules/graph/jar/org.scilab.modules.graph.jar:/usr/share/scilab/modules/javasci/jar/org.scilab.modules.javasci.jar:/usr/share/scilab/modules/history_manager/jar/org.scilab.modules.history_manager.jar:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.scilab.modules.jvm.LibraryPath (file:/usr/share/scilab/modules/jvm/jar/org.scilab.modules.jvm.jar) to field java.lang.ClassLoader.sys_paths
WARNING: Please consider reporting this to the maintainers of org.scilab.modules.jvm.LibraryPath
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
commons module not found.
graphic_objects module not found.
ui_data module not found.
graph module not found.
history_browser module not found.
slint module not found.
coverage module not found.
New1997 commented 5 years ago

Do I need to purge all and install manually from scilab official page? (This one is the ubuntu from apt-get so I can't even use ATOMS)

blink1073 commented 5 years ago

Are you able to interact with that session? If so, what does disp(prompt()) show?

New1997 commented 5 years ago

Nothing

blink1073 commented 5 years ago

Yeah, something is corrupt then. Getting a working version of Scilab that shows that prompt is apparently the entry point :smile:

New1997 commented 5 years ago

I can interact with it but it won't show any results but when using scilab-adv-cli I can use plot or surf and it create a new graphic window without any problem

New1997 commented 5 years ago

It only happens when I attempt to install scilab_kernel using python pip for the first time then even if I pruge everything it stays the same

blink1073 commented 5 years ago

Hmm, maybe try with the adv-cli with a fresh install?

New1997 commented 5 years ago

I think I will install using the package directly from scilab, I will purge everything for now Then I will comeback

blink1073 commented 5 years ago

oh I see, you did that

blink1073 commented 5 years ago

I'm not sure, we're just sending commands for scilab to run and waiting for --> to come back.

New1997 commented 5 years ago

when using in cli or adv-cli the terminal went dead only the gui version works

blink1073 commented 5 years ago

I'm curious if you can plot from adv-cli from a fresh install

New1997 commented 5 years ago

I download scilab6.0.2.gz and extract the files Everything works fine including scilab-adv-cli, it show plot, so how to make jupyter recognize the kernel?

New1997 commented 5 years ago

I don't know why but it takes too much time, then it hangs

New1997 commented 5 years ago

ok, the question earlier says a lot about me (I am newbie) and it was answered earlier: export SCILAB_EXECUTABLE=~/scilab-6.0.2/bin/scilab-cli in ~/.bashrc So I will just stick to scilab from .gz rather than try the impossible with the package from apt-get

blink1073 commented 5 years ago

so with that variable defined, does the kernel start now?

New1997 commented 5 years ago

yep thanks, you can close the ticket i might be because of the ubuntu version so someone need to contact them maybe?