I can not use jupyter notebook suddenly - jupyter-notebook

I can not use jupyter notebook suddenly. I just updated the system of my mac, before I started notebook. Following is the error.
[W 21:44:52.515 NotebookApp] server_extensions is deprecated, use nbserver_extensions
[I 21:44:52.964 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.2.5
[I 21:44:52.968 NotebookApp] Serving notebooks from local directory: /Users/william/Folders/jupyter
[I 21:44:52.968 NotebookApp] 0 active kernels
[I 21:44:52.968 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=159e4e1df709b7a94adb260448f671b9f9689d7b9b388fc5
[I 21:44:52.968 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 21:44:52.973 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=159e4e1df709b7a94adb260448f671b9f9689d7b9b388fc5
0:97: execution error: “"http://localhost:8888/tree?token=f0ef33a1f3bc91981dfe0dca2c1479a3cd718e775ea33c23"” dosen't understand information “open location”。 (-1708)

I think the issue is due to MAC upgrade to 10.12.5. To fix the issue follow below steps
Step1: Open the terminal and go to ~/.jupyter folder
Step2: Create a config file jupyter_notebook_config.py and write the following command inside it and save the file in the same location:
c.NotebookApp.browser = u'safari'
Step3: Come out and in terminal type jupyter notebook, it should work now.

Related

I cannot access Jupyter Notebook from remote HPC system

What I want to do is connecting Jupyter Notebook to a remote HPC system.
So, firstly I get the access to the HPC with the following line of code:
ssh -o TCPKeepAlive=true a06upi0e#cometa.hpc.cineca.it
Then, I insert the password and I can have the access to the system.
I load anaconda module with the following script:
module load anaconda/3.7
I activate 'myenv' environment:
conda activate myenv
I run this code to access jupyter notebook:
(myenv) [a06upi0e#login09 ~]$ jupyter notebook --no-browser --ip=127.0.0.1 --port=8888
This is the output:
[W 17:38:56.844 NotebookApp] Loading JupyterLab as a classic notebook (v6) extension.
[W 2023-02-17 17:38:56.853 LabApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2023-02-17 17:38:56.853 LabApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2023-02-17 17:38:56.853 LabApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2023-02-17 17:38:56.853 LabApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[I 2023-02-17 17:38:56.872 LabApp] JupyterLab extension loaded from /g100/home/usera06upi/a06upi0e/.conda/envs/myenv/lib/python3.8/site-packages/jupyterlab
[I 2023-02-17 17:38:56.873 LabApp] JupyterLab application directory is /g100/home/usera06upi/a06upi0e/.conda/envs/myenv/share/jupyter/lab
[I 17:38:56.893 NotebookApp] Serving notebooks from local directory: /g100/home/usera06upi/a06upi0e
[I 17:38:56.893 NotebookApp] Jupyter Notebook 6.5.2 is running at:
[I 17:38:56.894 NotebookApp] http://127.0.0.1:8888/?token=2c11ef7864a2804cae3b0f650527067f5420778909baf5e1
[I 17:38:56.894 NotebookApp] or http://127.0.0.1:8888/?token=2c11ef7864a2804cae3b0f650527067f5420778909baf5e1
[I 17:38:56.894 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 17:38:56.920 NotebookApp]
To access the notebook, open this file in a browser:
file:///g100/home/usera06upi/a06upi0e/.local/share/jupyter/runtime/nbserver-22202-open.html
Or copy and paste one of these URLs:
http://127.0.0.1:8888/?token=2c11ef7864a2804cae3b0f650527067f5420778909baf5e1
or http://127.0.0.1:8888/?token=2c11ef7864a2804cae3b0f650527067f5420778909baf5e1
Then, from another terminal on local I run this:
ssh -N -f -L localhost:8889:localhost:8888 a06upi0e#cometa.hpc.cineca.it
It askes me to enter the password related to the HPC remote system. So, I enter the password
a06upi0e#cometa.hpc.cineca.it's password:
And I open this link (http://127.0.0.1:8888/?token=2c11ef7864a2804cae3b0f650527067f5420778909baf5e1) to the browser. The problem is that I cannot get the access to the link: it says to me that it's impossible to reach the website.
What should I do? I tried changing ports but without succeeding.

Language Server Spec Finder Errors When Launching Jupyter Lab

I would just like to understand what's happening below. I am using MacOs and recently switched from bash to zsh. And then I installed jupyterlab-lsp. Can you please enlighten me?
[W 14:27:11.102 LabApp] Failed to fetch commands from language server spec finder`bash-language-server`:
expected str, bytes or os.PathLike object, not tuple
[W 14:27:11.108 LabApp] Failed to fetch commands from language server spec finder`dockerfile-language-server-nodejs`:
expected str, bytes or os.PathLike object, not tuple
[W 14:27:11.113 LabApp] Failed to fetch commands from language server spec finder`javascript-typescript-langserver`:
expected str, bytes or os.PathLike object, not tuple
[W 14:27:11.125 LabApp] Failed to fetch commands from language server spec finder`unified-language-server`:
expected str, bytes or os.PathLike object, not tuple
[W 14:27:11.129 LabApp] Failed to fetch commands from language server spec finder`vscode-css-languageserver-bin`:
expected str, bytes or os.PathLike object, not tuple
[W 14:27:11.133 LabApp] Failed to fetch commands from language server spec finder`vscode-html-languageserver-bin`:
expected str, bytes or os.PathLike object, not tuple
[W 14:27:11.138 LabApp] Failed to fetch commands from language server spec finder`vscode-json-languageserver-bin`:
expected str, bytes or os.PathLike object, not tuple
[W 14:27:11.142 LabApp] Failed to fetch commands from language server spec finder`yaml-language-server`:
expected str, bytes or os.PathLike object, not tuple
[I 14:27:11.193 LabApp] JupyterLab extension loaded from /Users/emilolbinado/anaconda3/lib/python3.6/site-packages/jupyterlab
[I 14:27:11.193 LabApp] JupyterLab application directory is /Users/emilolbinado/anaconda3/share/jupyter/lab
[I 14:27:11.195 LabApp] Serving notebooks from local directory: /Users/emilolbinado
[I 14:27:11.195 LabApp] The Jupyter Notebook is running at:
[I 14:27:11.195 LabApp] http://localhost:8888/?token=95a48a55a6638a48cbfa24c95106903144ffaafe10a65652
[I 14:27:11.195 LabApp] or http://127.0.0.1:8888/?token=95a48a55a6638a48cbfa24c95106903144ffaafe10a65652
[I 14:27:11.195 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:27:11.202 LabApp]
To access the notebook, open this file in a browser:
file:///Users/emilolbinado/Library/Jupyter/runtime/nbserver-8098-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=95a48a55a6638a48cbfa24c95106903144ffaafe10a65652
or http://127.0.0.1:8888/?token=95a48a55a6638a48cbfa24c95106903144ffaafe10a65652
Opening in existing browser session.
[I 14:27:14.645 LabApp] Build is up to date
[I 14:27:21.183 LabApp] Kernel started: 5c355536-12b0-41de-8c81-cc2afef6a85c
[I 14:27:21.218 LabApp] Kernel started: 9505d56b-0f5a-43f4-970e-990fa0852522
The issue is because jupyter server is unable to find the language servers. As in my case, jupyter is installed and maintained using conda environment(miniconda) under /opt/miniconda3/, whilst my nodejs is sitting under /usr/local/. Ideally, if you are already using conda manager, you will want to uninstall nodejs completely and reinstall it using conda. Otherwise, remove the entire anaconda/conda and then reinstall python (https://www.python.org/downloads/release/python-381/) and jupyter using either pip or brew depending how/where you installed nodejs.
I was able to resolve my issue following below steps:
1.) Completely uninstall node js. I was able to do it by running nvm uninstall <version> or if you are using homebrew, run brew uninstall node and then rm -f /usr/local/bin/npm on terminal. Additionally, you can follow below reference: How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
2.) Reinstall nodejs. conda install -c conda-forge nodejs
3.) Install the language servers. See reference: https://github.com/krassowski/jupyterlab-lsp/blob/master/LANGUAGESERVERS.md#installing-language-servers
4.) Restart terminal and run jupyter lab.
Now this is the best answer that I have that was able to resolve my issue.

Jupyter notebook just could not to serve for remote access

I'm configuring jupyter notebook on a linux server(Red Hat 4.8.5).I want to use a remote client to visit jupyter notebook.
First of all,I generated a config file:
jupyter notebook --generate-config
And then I modified the config file /root/.jupyter/jupyter_notebook_config.py:
c.NotebookApp.ip="0.0.0.0"
c.NotebookApp.allow_origin='*'
c.NotebookApp.open_browser=False
c.NotebookApp.password=u"sha1:16715d2ac300:ee938c81001cfd0841f8bf1441bd02038b62965e"
c.NotebookApp.port=9999
c.NotebookApp.notebook_dir='/home/jupyter_notebook'
Finally,I run the jupyter notebook:
jupyter notebook --config /root/.jupyter/jupyter_notebook_config.py --allow-root
However,The jupyter was just running the server at localhost:
[root#localhost home]# jupyter notebook --allow-root --config /root/.jupyter/jupyter_notebook_config.py
[I 18:22:45.287 NotebookApp] Serving notebooks from local directory: /home/jupyter_notebook
[I 18:22:45.287 NotebookApp] The Jupyter Notebook is running at:
[I 18:22:45.287 NotebookApp] http://(localhost or 127.0.0.1):9999/
[I 18:22:45.287 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
When I use the same config file to run jupyter notebook on my Aliyun server(Ubuntu 16),it worked:
[I 17:48:59.388 NotebookApp] Serving notebooks from local directory: /home/jupyter_notebook
[I 17:48:59.388 NotebookApp] The Jupyter Notebook is running at:
[I 17:48:59.389 NotebookApp] http://(iZbp14dhkm7uc5lnu5j510Z or 127.0.0.1):8888/
[I 17:48:59.389 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
I don't know what the problem is.I've searched a lot,but just cannot find a solution.
Any suggestions will be welcomed.
I've solved the problem. It's because my server's 9999 port is not opening to the Internet.

Why activating Jupyter with xeus-cling fails

I am trying to activate Jupiter with xeus-cling C++ kernel on windows 10
I did the following:
Installed a brand new Miniconda
Created a new environment
Installed Jupyter (unisng conda install)
Installed xeus-cling using the command :
conda install xeus-cling notebook -c QuantStack -c conda-forge
I activated the Jupyter notebook and got the following kernel error
[I 22:30:00.589 NotebookApp] Serving notebooks from local directory: C:\Users\IlanH
[I 22:30:00.589 NotebookApp] The Jupyter Notebook is running at:
[I 22:30:00.605 NotebookApp] http://localhost:8888/?token=8cb940353f781842ede9d93e3489b7d108179ad11837e49e
[I 22:30:00.605 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 22:30:00.855 NotebookApp]
To access the notebook, open this file in a browser:
file:///C:/Users/IlanH/AppData/Roaming/jupyter/runtime/nbserver-13328-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=8cb940353f781842ede9d93e3489b7d108179ad11837e49e
[I 22:30:16.874 NotebookApp] Creating new notebook in
[I 22:30:21.022 NotebookApp] Kernel started: bd4fa5d4-5007-4f70-b7bb-bf8eca013c99
2
2
2
2
2
2
2
2
2
2
2
2
2
2
ERROR in cling::CIFactory::createCI():
resource directory C:/bld/xeus-cling_1544660831115/_b_env/Library\lib\clang\5.0.0 not found!
input_line_1:1:10: fatal error: 'new' file not found
#include <new>
^~~~~
Warning in cling::IncrementalParser::CheckABICompatibility():
Possible C++ standard library mismatch, compiled with _CRT_MSVCP_CURRENT 'msvcp140.dll'
Extraction of runtime standard library version was: ''
[I 22:30:29.949 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
2
2
[I 22:30:00.589 NotebookApp] Serving notebooks from local directory: C:\Users\IlanH
[I 22:30:00.589 NotebookApp] The Jupyter Notebook is running at:
[I 22:30:00.605 NotebookApp] http://localhost:8888/?token=8cb940353f781842ede9d93e3489b7d108179ad11837e49e
[I 22:30:00.605 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 22:30:00.855 NotebookApp]
To access the notebook, open this file in a browser:
file:///C:/Users/IlanH/AppData/Roaming/jupyter/runtime/nbserver-13328-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=8cb940353f781842ede9d93e3489b7d108179ad11837e49e
[I 22:30:16.874 NotebookApp] Creating new notebook in
[I 22:30:21.022 NotebookApp] Kernel started: bd4fa5d4-5007-4f70-b7bb-bf8eca013c99
2
2
2
2
2
2
2
2
2
2
2
2
2
2
ERROR in cling::CIFactory::createCI():
resource directory C:/bld/xeus-cling_1544660831115/_b_env/Library\lib\clang\5.0.0 not found!
input_line_1:1:10: fatal error: 'new' file not found
#include <new>
^~~~~
Warning in cling::IncrementalParser::CheckABICompatibility():
Possible C++ standard library mismatch, compiled with _CRT_MSVCP_CURRENT 'msvcp140.dll'
Extraction of runtime standard library version was: ''
[I 22:30:29.949 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
2
2
What can I do to solve the problem ?
Ilan
Afraid its just a matter of support. Windows is not yet supported... you will have to use linux or OS X for now.

How to display Jupyter Notebook connection info while everything else sent to a log file?

I am writing a developer tool, part of which will launch a Jupyter notebook in the background with output sent to a particular file, such as
jupyter notebook --ip 0.0.0.0 --no-browser --allow-root \
>> ${NOTEBOOK_LOGFILE} 2>&1 &
However, I still want the notebook's start-up information to be printed to the console via stdout. Such as
[I 18:25:33.166 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[I 18:25:33.189 NotebookApp] Serving notebooks from local directory: /faces
[I 18:25:33.189 NotebookApp] 0 active kernels
[I 18:25:33.189 NotebookApp] The Jupyter Notebook is running at: http://0.0.0.0:8888/?token=b02f25972...
[I 18:25:33.189 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 18:25:33.189 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://0.0.0.0:8888/?token=b02f25972...
so that users can still see which URL connection string they need.
I have tried to cat this file after the notebook command but this has some downsides.
The time it takes for the notebook to launch and print the message is variable, and using a combination of sleep along with cat the log file is undesirable, because if there's a rare delay in start-up time, cat of the log file might print nothing because the file is empty.
On the other hand, I don't want to set the sleep time to an overly high number, because then users will have to wait too long at startup.
I have also tried tail -f ${NOTEBOOK_LOGFILE} | grep -n 10 (because the start-up lines will be the first 10). This is promising, but the notebook server does not append a newline to each line until the next line is incoming. This means if you wait for 10 lines, the tail process will hang until some other message is logged to the log file (producing the 10th newline).
How can I ensure that the start-up information is displayed to stdout in a timely fashion from when the notebook outputs this information, while still redirecting notebook output into a log file?
I figured a hack to do it with tail and head, but would be interested in something simpler.
(tail -f -n +1 ${NOTEBOOK_LOGFILE} | head -n 5);
This relies on the fact that the connection URL is also printed among the first 5 lines, and so it won't matter about the lack of newline that keeps head waiting if you try to extract it from lines 9 and 10.

Resources