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

Great, glad you got sorted!

ordonezt commented 4 years ago

Hi! I'm having an similar issue. I'm using Scilab 6.1.0, Jupyter-Notebook 6.0.1, IPython 7.8.0

I tried pip install scilab_kernel Set the export SCILAB_EXECUTABLE=/scilab-6.1.0/bin/scilab-adv-cli in /home/.bashrc editing it with nano

If i run echo $SCILAB_EXECUTABLE i get: /home/ord/scilab-6.1.0/bin/scilab-adv-cli

But when i run ipython notebook and open a scilab notebook i get:

[I 13:25:12.924 NotebookApp] Kernel started: bd817fea-fb54-46d4-b62b-7d1d4fd6beaa [MetaKernelApp] ERROR | Exception in message handler: Traceback (most recent call last): File "/home/ord/anaconda3/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 272, in dispatch_shell yield gen.maybe_future(handler(stream, idents, msg)) File "/home/ord/anaconda3/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 655, in kernel_info_request content.update(self.kernel_info) File "/home/ord/anaconda3/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 649, in kernel_info 'banner': self.banner, File "/home/ord/anaconda3/lib/python3.7/site-packages/scilab_kernel/kernel.py", line 78, in banner call = '%s -version -nwni || true' % self.executable File "/home/ord/anaconda3/lib/python3.7/site-packages/scilab_kernel/kernel.py", line 69, in executable raise OSError(msg) OSError: Scilab Executable not found, please add to path or set"SCILAB_EXECUTABLE" environment variable

Also if i run python -m scilab_kernel.check i get:

Scilab kernel v0.9.10 Metakernel v0.24.3 Python v3.7.4 (default, Aug 13 2019, 20:35:49) [GCC 7.3.0] Python path: /home/ord/anaconda3/bin/python

Connecting to Scilab... Scilab connection established Scilab Executable not found, please add to path or set"SCILAB_EXECUTABLE" environment variable

blink1073 commented 4 years ago

Hi @New1997, I think the issue is that the which function is not seeing that file as executable. You can verify in ipython:

import os
from metakernel.pexpect import which
which(os.environ('SCILAB_EXECUTABLE')
ordonezt commented 4 years ago

Yes! Thank you, it's fixed now but i don't like my solution.

The problem was that i followed the instructions in this video to make an "executable icon" of Scilab and Xcos, that makes me move the Scilab files (/scilab-6.1.0) to /opt folder.

Then i made the SCILAB_EXECUTABLE variable like this: export SCILAB_EXECUTABLE=opt/scilab-6.1.0/bin/scilab-adv-cli

Then i run: import os from metakernel.pexpect import which which(os.environ['SCILAB_EXECUTABLE']) And i get nothing

But if i move the Scilab files (/scilab-6.1.0) to /home/ord and make the export SCILAB_EXECUTABLE=~/scilab-6.1.0/bin/scilab-adv-cli Then run: import os from metakernel.pexpect import which which(os.environ['SCILAB_EXECUTABLE']) I get Out[3]: '/home/ord/scilab-6.1.0/bin/scilab-adv-cli' And all works! But i get duplicated the /scilab-6.1.0 folder in /home/user and /opt and it might have consequences. What is the correct way to fix this?

blink1073 commented 4 years ago

It looks like you had typos both times, first export SCILAB_EXECUTABLE=/scilab-6.1.0/bin/scilab-adv-cli (no opt), then export SCILAB_EXECUTABLE=opt/scilab-6.1.0/bin/scilab-adv-cli (no leading slash).

ordonezt commented 4 years ago

You are right, my bad! Thank you so much!!