Jupyter notebook not launching from navigator or command prompt - python

I'm using Anaconda. I cannot get jupyter notebooks to launch from either the navigator or the command prompt. I'm working from windows 10. I've tried jupyter notebook --debug and get the following results.
[D 10:11:30.573 NotebookApp] Searching ['C:\\Users\\Zachary', 'C:\\Users\\Zachary\\.jupyter', 'C:\\Users\\Zachary\\Anaconda3\\etc\\jupyter', 'C:\\ProgramData\\jupyter'] for config files
[D 10:11:30.574 NotebookApp] Looking for jupyter_config in C:\ProgramData\jupyter
[D 10:11:30.574 NotebookApp] Looking for jupyter_config in C:\Users\Zachary\Anaconda3\etc\jupyter
[D 10:11:30.575 NotebookApp] Looking for jupyter_config in C:\Users\Zachary\.jupyter
[D 10:11:30.576 NotebookApp] Looking for jupyter_config in C:\Users\Zachary
[D 10:11:30.576 NotebookApp] Looking for jupyter_notebook_config in C:\ProgramData\jupyter
[D 10:11:30.577 NotebookApp] Looking for jupyter_notebook_config in C:\Users\Zachary\Anaconda3\etc\jupyter
[D 10:11:30.577 NotebookApp] Loaded config file: C:\Users\Zachary\Anaconda3\etc\jupyter\jupyter_notebook_config.json
[D 10:11:30.577 NotebookApp] Looking for jupyter_notebook_config in C:\Users\Zachary\.jupyter
[D 10:11:30.578 NotebookApp] Looking for jupyter_notebook_config in C:\Users\Zachary
seems like its getting hung up somehow or not finding the files it needs. I've tried uninstalling anaconda and reinstalling and I'm having the same issues. Any suggestions to get jupyter notebooks working would be much appreciated.
Edit: I've gone to localhost:8888 and nothing is there.

Related

"Invalid credentials" when running `jupyter notebook --no-browser` from remote server

I tried everything here and nothing worked:
Jupyter Notebook Server password invalid
How to disable password request for a Jupyter notebook session?
When I generate a password it doesn't give me a token but when I type in the password it doesn't work. When I copy and paste my token, it also doesn't work.
$ jupyter notebook --no-browser
[I 2022-08-04 13:37:32.069 LabApp] JupyterLab extension loaded from ~/anaconda3/lib/python3.9/site-packages/jupyterlab
[I 2022-08-04 13:37:32.069 LabApp] JupyterLab application directory is ~/anaconda3/share/jupyter/lab
[I 13:37:32.073 NotebookApp] Serving notebooks from local directory: /home/jespinoz
[I 13:37:32.073 NotebookApp] Jupyter Notebook 6.4.8 is running at:
[I 13:37:32.073 NotebookApp] http://localhost:8888/?token=469451b2e8ec80432a0948fbbe8662347695efd8f5339307
[I 13:37:32.073 NotebookApp] or http://127.0.0.1:8888/?token=469451b2e8ec80432a0948fbbe8662347695efd8f5339307
[I 13:37:32.073 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 13:37:32.132 NotebookApp]
To access the notebook, open this file in a browser:
file:///home/jespinoz/.local/share/jupyter/runtime/nbserver-3346536-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=469451b2e8ec80432a0948fbbe8662347695efd8f5339307
or http://127.0.0.1:8888/?token=469451b2e8ec80432a0948fbbe8662347695efd8f5339307
This did nothing:
c.NotebookApp.token = ''
c.NotebookApp.password = u''
c.NotebookApp.open_browser = True
c.NotebookApp.ip = 'localhost'
Neither did just this:
c.NotebookApp.token = ''
Nor this:
jupyter notebook password
Nor this:
jupyter notebook --ip='*' --NotebookApp.token='' --NotebookApp.password=''

Fresh conda installation of jupyter lab cannot connect to kernel

I'm trying to run jupyter lab with miniconda, but Jupyter is having trouble connecting with the kernel. Below is some background info, the steps I've done, and the code that results.
Background Info
I have been successfully using jupyter lab for months.
It was only today that this problem started occurring.
I suspected that this is related to the fact that I installed XCode Command Line Tools 13 this morning, which was only released yesterday, but the same problem occurred after a downgrade to 12.5.1.
I am using miniconda.
Steps
Create a fresh conda environment
Activate it with conda activate test
I then run conda install jupyterlab
After installation, I run jupyter lab to open the browser and navigate to my .ipynb
Now, the bottom left corner of the browser reads "Python 3 (ipykernel) | Connecting", which doesn't say much. Here's a summary of the logs:
Regular log output
There's the initial info (which I don't think contains anything novel, but may help to answer some questions you might have that I haven't thought of):
[I 2021-09-21 09:36:33.353 ServerApp] jupyterlab | extension was successfully linked.
[I 2021-09-21 09:36:34.278 ServerApp] nbclassic | extension was successfully linked.
[I 2021-09-21 09:36:34.509 LabApp] JupyterLab extension loaded from /opt/miniconda3/envs/test/lib/python3.9/site-packages/jupyterlab
[I 2021-09-21 09:36:34.509 LabApp] JupyterLab application directory is /opt/miniconda3/envs/test/share/jupyter/lab
[I 2021-09-21 09:36:34.515 ServerApp] jupyterlab | extension was successfully loaded.
[I 2021-09-21 09:36:34.526 ServerApp] nbclassic | extension was successfully loaded.
[I 2021-09-21 09:36:34.527 ServerApp] Serving notebooks from local directory: /Users/connorpancoast/Code/grassmaNN
[I 2021-09-21 09:36:34.527 ServerApp] Jupyter Server 1.4.1 is running at:
[I 2021-09-21 09:36:34.527 ServerApp] http://localhost:8888/lab?token=fa21e773398a0c8bbeccdb7a67ffb20950bac831209b9373
[I 2021-09-21 09:36:34.527 ServerApp] or http://127.0.0.1:8888/lab?token=fa21e773398a0c8bbeccdb7a67ffb20950bac831209b9373
[I 2021-09-21 09:36:34.527 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2021-09-21 09:36:34.535 ServerApp]
To access the server, open this file in a browser:
file:///Users/connorpancoast/Library/Jupyter/runtime/jpserver-24903-open.html
Or copy and paste one of these URLs:
http://localhost:8888/lab?token=fa21e773398a0c8bbeccdb7a67ffb20950bac831209b9373
or http://127.0.0.1:8888/lab?token=fa21e773398a0c8bbeccdb7a67ffb20950bac831209b9373
After this is when things get strange.
Strange log output
First is this warning about nodejs, which may or may not be important.
[W 2021-09-21 09:36:39.621 LabApp] Could not determine jupyterlab build status without nodejs
/opt/miniconda3/envs/test/lib/python3.9/json/encoder.py:257: UserWarning: date_default is deprecated since jupyter_client 7.0.0. Use jupyter_client.jsonutil.json_default.
return _iterencode(o, 0)
Next, the kernel starts, but there's a connection timeout.
[I 2021-09-21 09:36:51.114 ServerApp] Kernel started: b38270f5-9a72-42cf-86e5-0e8e4b3b9514
[W 2021-09-21 09:37:51.549 ServerApp] Timeout waiting for kernel_info reply from b38270f5-9a72-42cf-86e5-0e8e4b3b9514
[W 2021-09-21 09:37:56.092 ServerApp] Nudge: attempt 10 on kernel b38270f5-9a72-42cf-86e5-0e8e4b3b9514
[W 2021-09-21 09:37:56.093 ServerApp] Nudge: attempt 10 on kernel b38270f5-9a72-42cf-86e5-0e8e4b3b9514
[W 2021-09-21 09:37:56.109 ServerApp] Nudge: attempt 10 on kernel b38270f5-9a72-42cf-86e5-0e8e4b3b9514
I'm unsure why three separate "nudge processes" are occurring, but after 120 nudge attempts (shown), this error message also appears three times, not shown for space:
[W 2021-09-21 09:38:51.474 ServerApp] Nudge: attempt 120 on kernel b38270f5-9a72-42cf-86e5-0e8e4b3b9514
[W 2021-09-21 09:38:51.475 ServerApp] Nudge: attempt 120 on kernel b38270f5-9a72-42cf-86e5-0e8e4b3b9514
[W 2021-09-21 09:38:51.476 ServerApp] Nudge: attempt 120 on kernel b38270f5-9a72-42cf-86e5-0e8e4b3b9514
[E 2021-09-21 09:38:51.558 ServerApp] Uncaught exception GET /api/kernels/b38270f5-9a72-42cf-86e5-0e8e4b3b9514/channels?session_id=f834b0b3-b8ed-4b2d-bfc9-7a535593a24f (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/kernels/b38270f5-9a72-42cf-86e5-0e8e4b3b9514/channels?session_id=f834b0b3-b8ed-4b2d-bfc9-7a535593a24f', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/opt/miniconda3/envs/test/lib/python3.9/site-packages/tornado/websocket.py", line 956, in _accept_connection
await open_result
tornado.util.TimeoutError: Timeout
After those, these appear:
[W 2021-09-21 09:39:21.571 ServerApp] WebSocket ping timeout after 90003 ms.
[W 2021-09-21 09:39:21.585 ServerApp] WebSocket ping timeout after 90003 ms.
[W 2021-09-21 09:42:51.594 ServerApp] Replacing stale connection: b38270f5-9a72-42cf-86e5-0e8e4b3b9514:ee46fa70-0af0-489d-8993-acf4f55bf3aa
[W 2021-09-21 09:42:52.123 ServerApp] Replacing stale connection: b38270f5-9a72-42cf-86e5-0e8e4b3b9514:ee46fa70-0af0-489d-8993-acf4f55bf3aa
/opt/miniconda3/envs/test/lib/python3.9/json/encoder.py:257: UserWarning: date_default is deprecated since jupyter_client 7.0.0. Use jupyter_client.jsonutil.json_default.
return _iterencode(o, 0)
[I 2021-09-21 09:46:52.126 ServerApp] Starting buffering for b38270f5-9a72-42cf-86e5-0e8e4b3b9514:ee46fa70-0af0-489d-8993-acf4f55bf3aa
[W 2021-09-21 09:46:52.146 ServerApp] Replacing stale connection: b38270f5-9a72-42cf-86e5-0e8e4b3b9514:f834b0b3-b8ed-4b2d-bfc9-7a535593a24f
[W 2021-09-21 09:46:55.306 ServerApp] Replacing stale connection: b38270f5-9a72-42cf-86e5-0e8e4b3b9514:1db7c82b-2627-4c43-b9d3-da7bef15ca32
I also use Jupyter Lab with Miniconda, and this is what I did a few days ago.
It seems that you need the install node.js and ipykernel with:
conda install nodej ipykernel
Also, I read somewhere that you need to "tell" Jupyter Lab to use your environment as follow:
python -m ipykernel install --user --name test --display-name “enviroment_test”
Note that test is your environment name, and “enviroment_test” is the name that it will show in Jupyter.
Finally, I would suggest installing Jupyter from conda-forge with:
conda install jupyterlab -c conda-forge
Obs.: all this need to be done with your desired environment activated

Jupyter Notebook kernel restarts every time I import pixiedust

Running one line of code "import pixiedust" makes the kernel die and automatically restart every time I try it. I'm using Jupyter Notebook via Anaconda in MacOS BigSur 11.2.3.
import pixiedust
this is my only line of code, the rest of my code works fine (the part not using pixiedust).
that's the terminal output:
Last login: Sat Mar 27 16:26:47 on ttys001
/Users/avic/opt/anaconda3/bin/jupyter_mac.command ; exit;
(base) avic#Avis-MBP ~ % /Users/avic/opt/anaconda3/bin/jupyter_mac.command ; exit;
[I 16:31:00.239 NotebookApp] JupyterLab extension loaded from /Users/avic/opt/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 16:31:00.239 NotebookApp] JupyterLab application directory is /Users/avic/opt/anaconda3/share/jupyter/lab
[I 16:31:00.242 NotebookApp] Serving notebooks from local directory: /Users/avic
[I 16:31:00.242 NotebookApp] The Jupyter Notebook is running at:
[I 16:31:00.242 NotebookApp] http://localhost:8888/?token=8d705f0c1f4efa59a8d4edc4643ad87ded410f4af2f62ea6
[I 16:31:00.242 NotebookApp] or http://127.0.0.1:8888/?token=8d705f0c1f4efa59a8d4edc4643ad87ded410f4af2f62ea6
[I 16:31:00.242 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 16:31:00.249 NotebookApp]
To access the notebook, open this file in a browser:
file:///Users/avic/Library/Jupyter/runtime/nbserver-57976-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=8d705f0c1f4efa59a8d4edc4643ad87ded410f4af2f62ea6
or http://127.0.0.1:8888/?token=8d705f0c1f4efa59a8d4edc4643ad87ded410f4af2f62ea6
[I 16:31:09.251 NotebookApp] Kernel started: b3400759-7e32-4b4d-87c8-77676fafe504
[I 16:31:15.255 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
kernel b3400759-7e32-4b4d-87c8-77676fafe504 restarted
I've never used this workspace before but I'm required to by my uni...
Please help :)

jupyter notebook keeps reconnecting

I'm getting error while connecting the jupyter notebook. It says connecting to the kernel. I'm not able to execute any of the queries in that. Could anyone help me out with this.
Below is the error message and logs in anaconda prompt.
LOGS ::
[I 16:48:48.414 NotebookApp] Adapting to protocol v5.1 for kernel 0eb0478c-3ad8-4c50-af16-31e66bf45358
[I 16:48:48.414 NotebookApp] Restoring connection for 0eb0478c-3ad8-4c50-af16-31e66bf45358:025E6CA0A7AB437F9F3FFF4C9F7A728C
[I 16:48:49.269 NotebookApp] Adapting to protocol v5.1 for kernel a9b2c0c5-63ab-4f60-b49f-12279703c32f
[I 16:48:49.270 NotebookApp] Restoring connection for a9b2c0c5-63ab-4f60-b49f-12279703c32f:974506A3ADF64A18A1C002CF49107209
[W 16:48:49.286 NotebookApp] zmq message arrived on closed channel
[W 16:48:49.286 NotebookApp] zmq message arrived on closed channel
[I 16:48:49.286 NotebookApp] Starting buffering for a9b2c0c5-63ab-4f60-b49f-12279703c32f:974506A3ADF64A18A1C002CF49107209
[I 16:48:51.263 NotebookApp] Adapting to protocol v5.1 for kernel a9b2c0c5-63ab-4f60-b49f-12279703c32f
[I 16:48:51.263 NotebookApp] Restoring connection for a9b2c0c5-63ab-4f60-b49f-12279703c32f:974506A3ADF64A18A1C002CF49107209
[I 16:48:51.278 NotebookApp] Starting buffering for a9b2c0c5-63ab-4f60-b49f-12279703c32f:974506A3ADF64A18A1C002CF49107209
[I 16:48:53.269 NotebookApp] Adapting to protocol v5.1 for kernel a9b2c0c5-63ab-4f60-b49f-12279703c32f
[I 16:48:53.269 NotebookApp] Restoring connection for a9b2c0c5-63ab-4f60-b49f-12279703c32f:974506A3ADF64A18A1C002CF49107209
[I 16:48:53.282 NotebookApp] Starting buffering for a9b2c0c5-63ab-4f60-b49f-12279703c32f:974506A3ADF64A18A1C002CF49107209
[I 16:48:55.257 NotebookApp] Adapting to protocol v5.1 for kernel a9b2c0c5-63ab-4f60-b49f-12279703c32f
[I 16:48:55.259 NotebookApp] Restoring connection for a9b2c0c5-63ab-4f60-b49f-12279703c32f:974506A3ADF64A18A1C002CF49107209
[I 16:48:55.275 NotebookApp] Starting buffering for a9b2c0c5-63ab-4f60-b49f-12279703c32f:974506A3ADF64A18A1C002CF49107209
If you are using jupyter behind a nginx proxy, this post may be effective.
Add this line to nginx conf.
proxy_http_version 1.1;

Jupyter and aarch64

What i have: NanoPi Neo2 (Allwinner A5 (arm v8 x64) processor, 512mb ram)
What I did:
apt-get install docker*
docker pull konmeo/jupyter (got here)
docker run -it --rm -p 8888:8888 4fdcd3a6ff59
it said [C 19:38:32.851 NotebookApp] Running as root is not recommended. Use --allow-root to bypass.
I runned docker run -it --rm -p 8888:8888 4fdcd3a6ff59 /usr/bin/jupyter notebook --allow-root, everything in docker is okay
[W 19:40:36.237 NotebookApp] server_extensions is deprecated, use nbserver_extensions
[I 19:40:36.287 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[I 19:40:39.827 NotebookApp] hide_code: Attempting to load hid_code export handler extensions.
[I 19:40:39.839 NotebookApp] hide_code: Hide_code export handler extensions loaded.
[I 19:40:39.972 NotebookApp] Loading IPython parallel extension
[I 19:40:40.238 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.2.4
[I 19:40:40.242 NotebookApp] Serving notebooks from local directory: /notebooks
[I 19:40:40.243 NotebookApp] 0 active kernels
[I 19:40:40.244 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=89a3809bd589557e08e31d7fbd475e6e17bb333fe2311745
[I 19:40:40.245 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 19:40:40.248 NotebookApp] No web browser found: could not locate runnable browser.
[C 19:40:40.250 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=89a3809bd589557e08e31d7fbd475e6e17bb333fe2311745
but I have no access neither using browser on local device nor using http://ip:8888/ in local network
What I should do to make it work?
Try binding docker to all interfaces.
-p 0.0.0.0:8888:8888

Categories