I do not know. I did not check first. Instead I just ran
jupyter notebook --generate-config
It did not prompt for Overwrite [y/N]. But I just re-ran this and I
now get a prompt so maybe it did not exist before.
wspage@desktop:~$ FDIR=$HOME/fricas
wspage@desktop:~$ source $FDIR/venv/jfricas/bin/activate
(jfricas) wspage@desktop:~$ jupyter notebook --generate-config
Overwrite /home/wspage/.jupyter/jupyter_notebook_config.py with
default config? [y/N]y
Writing default config to: /home/wspage/.jupyter/jupyter_notebook_config.py
(jfricas) wspage@desktop:~$
After re-creating the config file I tried running
(jfricas) wspage@desktop:~$ jfricas $FDIR/foo.input
[I 15:39:56.185 NotebookApp] Serving notebooks from local directory:
/home/wspage/fricas
[I 15:39:56.185 NotebookApp] 0 active kernels
[I 15:39:56.185 NotebookApp] The Jupyter Notebook is running at:
[I 15:39:56.185 NotebookApp]
http://localhost:8888/?token=c5c300794e7855ba2e9e1d32a372041518f27089419dcef2
[I 15:39:56.185 NotebookApp] Use Control-C to stop this server and
shut down all kernels (twice to skip confirmation).
[C 15:39:56.186 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=c5c300794e7855ba2e9e1d32a372041518f27089419dcef2
Opening in existing browser session.
[I 15:39:56.407 NotebookApp] Accepting one-time-token-authenticated
connection from 127.0.0.1
[I 15:39:56.409 NotebookApp] 302 GET
/notebooks/foo.input?token=8e615b4584b8a40575df4f1e176fd07aec2bb0759a9678d1
(127.0.0.1) 2.81ms
[1923:1923:0100/000000.497003:ERROR:sandbox_linux.cc(378)]
InitializeSandbox() called with multiple threads in process
gpu-process.
--
But nothing happens. I do not see anything in my browser. But I can
see that Jupyter is running if I enter
http://localhost:8888/?token=c5c300794e7855ba2e9e1d32a372041518f27089419dcef2
in the browser. If I logout and then exit (control-C) the Jupyter
session in the terminal, then
The Jupyter Notebook is running at:
http://localhost:8888/?token=c5c300794e7855ba2e9e1d32a372041518f27089419dcef2
Shutdown this notebook server (y/[n])? y
[C 15:44:10.548 NotebookApp] Shutdown confirmed
[I 15:44:10.549 NotebookApp] Shutting down 0 kernels
(jfricas) wspage@desktop:~$ jfricas
[I 15:44:31.826 NotebookApp] Serving notebooks from local directory:
/home/wspage
[I 15:44:31.826 NotebookApp] 0 active kernels
[I 15:44:31.826 NotebookApp] The Jupyter Notebook is running at:
[I 15:44:31.826 NotebookApp]
http://localhost:8888/?token=ae4481782fec549879e4ac2ed811328753aa618b148768dc
[I 15:44:31.826 NotebookApp] Use Control-C to stop this server and
shut down all kernels (twice to skip confirmation).
[C 15:44:31.827 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=ae4481782fec549879e4ac2ed811328753aa618b148768dc
[I 15:44:32.036 NotebookApp] Accepting one-time-token-authenticated
connection from 127.0.0.1
Opening in existing browser session.
[2284:2284:0502/154432.061548:ERROR:broker_posix.cc(43)] Invalid node
channel message
[2279:2279:0100/000000.128409:ERROR:sandbox_linux.cc(378)]
InitializeSandbox() called with multiple threads in process
gpu-process.
[2279:2279:0100/000000.128700:ERROR:broker_posix.cc(43)] Invalid node
channel message
[W 15:44:32.331 NotebookApp] 404 GET
/static/components/moment/locale/en-ca.js?v=20220502154431 (127.0.0.1)
6.21ms referer=
http://localhost:8888/tree
--
Then a new tab appears in my browser as expected normally.
> However, this redirect line was for me only necessary in Ubuntu 22.04.
> There when starting "jupyter notebook", firefox would open with a
> file://... URL and it would not redirect to the localhost URL where
> Jupyter is running.
Maybe I still need the redirect line? Should I add it manually or
should the sed script be modified a little?
> The actual problem is the jupytext line. What happened to
> c.NotebookApp.contents_manager_class in your case? Obviously it points
> to jupytext.
Yes. I see
--
## The config manager class to use
#c.NotebookApp.config_manager_class =
'notebook.services.config.manager.ConfigManager'
## The notebook manager class to use.
c.NotebookApp.contents_manager_class = "jupytext.TextFileContentsManager"
## Extra keyword arguments to pass to `set_secure_cookie`. See tornado's
# set_secure_cookie docs for details.
#c.NotebookApp.cookie_options = {}
--
in the editor
xed $HOME/.jupyter/jupyter_notebook_config.py
I see the following when I install
--
(jfricas) wspage@desktop:~$ pip3 install jupytext
The directory '/home/wspage/.cache/pip/http' or its parent directory
is not owned by the current user and the cache has been disabled.
Please check the permissions and owner of that directory. If executing
pip with sudo, you may want sudo's -H flag.
The directory '/home/wspage/.cache/pip' or its parent directory is not
owned by the current user and caching wheels has been disabled. check
the permissions and owner of that directory. If executing pip with
sudo, you may want sudo's -H flag.
Requirement already satisfied: jupytext in
./fricas/venv/jfricas/lib/python3.6/site-packages
Requirement already satisfied: toml in
./fricas/venv/jfricas/lib/python3.6/site-packages (from jupytext)
Requirement already satisfied: pyyaml in
./fricas/venv/jfricas/lib/python3.6/site-packages (from jupytext)
Requirement already satisfied: mdit-py-plugins in
./fricas/venv/jfricas/lib/python3.6/site-packages (from jupytext)
Requirement already satisfied: markdown-it-py<3.0.0,>=1.0.0 in
./fricas/venv/jfricas/lib/python3.6/site-packages (from jupytext)
Requirement already satisfied: nbformat in
./fricas/venv/jfricas/lib/python3.6/site-packages (from jupytext)
Requirement already satisfied: typing-extensions>=3.7.4;
python_version < "3.8" in
./fricas/venv/jfricas/lib/python3.6/site-packages (from
markdown-it-py<3.0.0,>=1.0.0->jupytext)
Requirement already satisfied: mdurl~=0.1 in
./fricas/venv/jfricas/lib/python3.6/site-packages (from
markdown-it-py<3.0.0,>=1.0.0->jupytext)
Requirement already satisfied: attrs<22,>=19 in
./fricas/venv/jfricas/lib/python3.6/site-packages (from
markdown-it-py<3.0.0,>=1.0.0->jupytext)
Requirement already satisfied: traitlets>=4.1 in
./fricas/venv/jfricas/lib/python3.6/site-packages (from
nbformat->jupytext)
Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in
./fricas/venv/jfricas/lib/python3.6/site-packages (from
nbformat->jupytext)
Requirement already satisfied: jupyter-core in
./fricas/venv/jfricas/lib/python3.6/site-packages (from
nbformat->jupytext)
Requirement already satisfied: ipython-genutils in
./fricas/venv/jfricas/lib/python3.6/site-packages (from
nbformat->jupytext)
Requirement already satisfied: six in
./fricas/venv/jfricas/lib/python3.6/site-packages (from
traitlets>=4.1->nbformat->jupytext)
Requirement already satisfied: decorator in
./fricas/venv/jfricas/lib/python3.6/site-packages (from
traitlets>=4.1->nbformat->jupytext)
Requirement already satisfied: importlib-metadata; python_version <
"3.8" in ./fricas/venv/jfricas/lib/python3.6/site-packages (from
jsonschema!=2.5.0,>=2.4->nbformat->jupytext)
Requirement already satisfied:
pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in
./fricas/venv/jfricas/lib/python3.6/site-packages (from
jsonschema!=2.5.0,>=2.4->nbformat->jupytext)
Requirement already satisfied: zipp>=0.5 in
./fricas/venv/jfricas/lib/python3.6/site-packages (from
importlib-metadata; python_version <
"3.8"->jsonschema!=2.5.0,>=2.4->nbformat->jupytext)
--
But running this command:
(jfricas) wspage@desktop:~$ jfricas $FDIR/foo.input
The Jupyter HTML Notebook.
This launches a Tornado based HTML Notebook Server that serves up an
HTML5/Javascript Notebook client.
Subcommands
-----------
...
To see all available configurables, use `--help-all`
Examples
--------
jupyter notebook # start the notebook
jupyter notebook --certfile=mycert.pem # use SSL/TLS certificate
jupyter notebook password # enter a password to
protect the server
[C 15:52:30.108 NotebookApp] Bad config encountered during initialization:
[C 15:52:30.108 NotebookApp] The 'contents_manager_class' trait of
<notebook.notebookapp.NotebookApp object at 0x7fbd8def4860> instance
must be a type, but 'jupytext.TextFileContentsManager' could not be
imported
(jfricas) wspage@desktop:~$
--
Still gives the above error.
> But then I can only guess that jupytext was not installed
> in the virtualenv ($HOME/fricas/venv).
>
The output of
pip3 install jupytext
seems to suggest otherwise. Is there something else I can check?
Bill.