Re: [Jgeneral] Running J in Jupyter

2020-08-23 Thread Francesco Pedulla'
Hi Chris,
yes, the command you suggest starts the J command line interpreter.
I agree that it looks like a Python problem, but:

   1. I'd expect the JDemo installation to use its own python interpreter
   and packages rather than the system-wide one
   2. in any case, my python 3.6.9 installation works fine, both from the
   command line and from my own jupyter install.

Maybe a list of required packages would help?
Thx,

Francesco

On Sun, Aug 23, 2020 at 9:00 PM chris burke  wrote:

> 1. Can you confirm that J does run on your machine, i.e. the following
> should load J;
>
>  ../JDemo/J805/bin/jconsole
>
> 2. Line 19 has "ModuleNotFoundError: No module named 'contextvars'"
>
> This looks like a Python problem, perhaps a mismatch between the
> download and your local copy of python?
>
> The download is a little old and may need updating.
>
> On Sat, Aug 22, 2020 at 10:41 AM Francesco Pedulla' 
> wrote:
> >
> > Dear all,
> > I cannot run J in a Jupyter notebook.
> > Following the instructions at
> > https://code.jsoftware.com/wiki/Guides/Jupyter, I:
> >
> >1. downloaded the 64bit compressed tar file for Linux
> >2. unpacked it under my home directory on a Ubuntu 18 desktop machine
> >3. cd to the new directory (/home/francesco/JDemo)
> >4. run the jupyter-notebook.sh script
> >5. in the freshly opened browser window (http://localhost:/tree),
> >selected New->J
> >6. waited while the kernel was starting and jupyter tried to connect
> to
> >it
> >7. give up after jupyter repeatedly failed to connect to the J kernel
> >(see attached stderr output).
> >
> > The error about the NaCl helper process at line 10 shows up also in
> another
> > installation of jupyter, on the same machine, where both python and
> > sagemath run fine. Hence, I believe it should be the reason for the
> > failure.
> > Error on line 19 looks more promising, but I am not sure how to interpret
> > it - even less how to fix it.
> > Any hint?
> > Thanks in advance,
> >
> > Francesco
> > --
> > For information about J forums see http://www.jsoftware.com/forums.htm
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jgeneral] Running J in Jupyter

2020-08-23 Thread chris burke
1. Can you confirm that J does run on your machine, i.e. the following
should load J;

 ../JDemo/J805/bin/jconsole

2. Line 19 has "ModuleNotFoundError: No module named 'contextvars'"

This looks like a Python problem, perhaps a mismatch between the
download and your local copy of python?

The download is a little old and may need updating.

On Sat, Aug 22, 2020 at 10:41 AM Francesco Pedulla'  wrote:
>
> Dear all,
> I cannot run J in a Jupyter notebook.
> Following the instructions at
> https://code.jsoftware.com/wiki/Guides/Jupyter, I:
>
>1. downloaded the 64bit compressed tar file for Linux
>2. unpacked it under my home directory on a Ubuntu 18 desktop machine
>3. cd to the new directory (/home/francesco/JDemo)
>4. run the jupyter-notebook.sh script
>5. in the freshly opened browser window (http://localhost:/tree),
>selected New->J
>6. waited while the kernel was starting and jupyter tried to connect to
>it
>7. give up after jupyter repeatedly failed to connect to the J kernel
>(see attached stderr output).
>
> The error about the NaCl helper process at line 10 shows up also in another
> installation of jupyter, on the same machine, where both python and
> sagemath run fine. Hence, I believe it should be the reason for the
> failure.
> Error on line 19 looks more promising, but I am not sure how to interpret
> it - even less how to fix it.
> Any hint?
> Thanks in advance,
>
> Francesco
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm


[Jgeneral] Running J in Jupyter

2020-08-22 Thread Francesco Pedulla'
Dear all,
I cannot run J in a Jupyter notebook.
Following the instructions at
https://code.jsoftware.com/wiki/Guides/Jupyter, I:

   1. downloaded the 64bit compressed tar file for Linux
   2. unpacked it under my home directory on a Ubuntu 18 desktop machine
   3. cd to the new directory (/home/francesco/JDemo)
   4. run the jupyter-notebook.sh script
   5. in the freshly opened browser window (http://localhost:/tree),
   selected New->J
   6. waited while the kernel was starting and jupyter tried to connect to
   it
   7. give up after jupyter repeatedly failed to connect to the J kernel
   (see attached stderr output).

The error about the NaCl helper process at line 10 shows up also in another
installation of jupyter, on the same machine, where both python and
sagemath run fine. Hence, I believe it should be the reason for the
failure.
Error on line 19 looks more promising, but I am not sure how to interpret
it - even less how to fix it.
Any hint?
Thanks in advance,

Francesco
[I 19:02:34.506 NotebookApp] Serving notebooks from local directory: 
/home/francesco/JDemo
[I 19:02:34.506 NotebookApp] 0 active kernels 
[I 19:02:34.506 NotebookApp] The Jupyter Notebook is running at: 
http://localhost:/?token=3755eafabab64f3cd508b25bb7136de161728d240ba5757f
[I 19:02:34.506 NotebookApp] Use Control-C to stop this server and shut down 
all kernels (twice to skip confirmation).
[C 19:02:34.510 NotebookApp] 

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:

http://localhost:/?token=3755eafabab64f3cd508b25bb7136de161728d240ba5757f
[0822/190234.863787:ERROR:nacl_helper_linux.cc(308)] NaCl helper process 
running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
[I 19:02:34.883 NotebookApp] Accepting one-time-token-authenticated connection 
from 127.0.0.1
[I 19:02:44.107 NotebookApp] Creating new notebook in 
[I 19:02:44.641 NotebookApp] Kernel started: 
3bc915f0-472e-44a7-bc5a-66c909a21fad
[W 19:02:44.694 NotebookApp] 404 GET 
/nbextensions/widgets/notebook/js/extension.js?v=20200822190234 (127.0.0.1) 
26.63ms 
referer=http://localhost:/notebooks/Untitled4.ipynb?kernel_name=jkernel
Traceback (most recent call last):
  File 
"/home/francesco/.local/lib/python3.6/site-packages/prompt_toolkit/application/current.py",
 line 6, in 
from contextvars import ContextVar
ModuleNotFoundError: No module named 'contextvars'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/francesco/JDemo/Python3/lib/python3.6/runpy.py", line 193, in 
_run_module_as_main
"__main__", mod_spec)
  File "/home/francesco/JDemo/Python3/lib/python3.6/runpy.py", line 85, in 
_run_code
exec(code, run_globals)
  File 
"/home/francesco/JDemo/Python3/lib/python3.6/site-packages/jkernel/jkernel.py", 
line 26, in 
from ipykernel.kernelbase import Kernel
  File 
"/home/francesco/.local/lib/python3.6/site-packages/ipykernel/__init__.py", 
line 2, in 
from .connect import *
  File 
"/home/francesco/.local/lib/python3.6/site-packages/ipykernel/connect.py", line 
13, in 
from IPython.core.profiledir import ProfileDir
  File 
"/home/francesco/.local/lib/python3.6/site-packages/IPython/__init__.py", line 
56, in 
from .terminal.embed import embed
  File 
"/home/francesco/.local/lib/python3.6/site-packages/IPython/terminal/embed.py", 
line 16, in 
from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File 
"/home/francesco/.local/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py",
 line 19, in 
from prompt_toolkit.enums import DEFAULT_BUFFER, EditingMode
  File 
"/home/francesco/.local/lib/python3.6/site-packages/prompt_toolkit/__init__.py",
 line 16, in 
from .application import Application
  File 
"/home/francesco/.local/lib/python3.6/site-packages/prompt_toolkit/application/__init__.py",
 line 1, in 
from .application import Application
  File 
"/home/francesco/.local/lib/python3.6/site-packages/prompt_toolkit/application/application.py",
 line 39, in 
from prompt_toolkit.buffer import Buffer
  File 
"/home/francesco/.local/lib/python3.6/site-packages/prompt_toolkit/buffer.py", 
line 28, in 
from .application.current import get_app
  File 
"/home/francesco/.local/lib/python3.6/site-packages/prompt_toolkit/application/current.py",
 line 8, in 
from prompt_toolkit.eventloop.dummy_contextvars import ContextVar  # type: 
ignore
  File 
"/home/francesco/.local/lib/python3.6/site-packages/prompt_toolkit/eventloop/__init__.py",
 line 1, in 
from .async_generator import generator_to_async_generator
  File 
"/home/francesco/.local/lib/python3.6/site-packages/prompt_toolkit/eventloop/async_generator.py",
 line 5, in 
from typing import AsyncGenerator, Callable, Iterable, TypeVar, Union
ImportError: cannot import name 'AsyncGenerator'
[I 19:02:47.643 NotebookApp] KernelRestarter: restarting