I am trying to run jupyter from local mac terminal. It used to work but not working when I did some changes in jupyter config file to connect the notebook to a remote server jupyter (which nev er worked without tunneling btw).
Here is the changes I did then:
# Local IP addresses (such as 127.0.0.1 and ::1) are allowed as local, along
# with hostnames configured in local_hostnames.
#c.NotebookApp.allow_remote_access = False
c.NotebookApp.allow_remote_access = True
So adding True to allow_remote_access option while keeping the default commented.
But now when I do "jupyter notebook" in termina directory, it keeps showiing opening in browser but never opens.
Related
I'm trying to connect and use jupyter notebooks on a Windows remote desktop. I can install jupyter fine and even run it perfectly, but whenever I try to access the notebook via browser, I get a "can't reach" message for localhost:8888.
After some extensive research online, where people just needed to change 127.0.0.1 to localhost or vice versa, or changed their browser, nothing seemed to work. Some threads also suggested I change up the config file and instead run jupyter notebook --ip 0.0.0.0 --port 8888. Furthermore, I tried using several different ports and even asked the IT administrator which port is definetly available, but this was all to no avail.
Delving deeper into the problem, I checked whether jupyter opened a port connection on the remote desktop by running netstat -aon | findstr :*port* in the terminal. This was not the case.
I'm dumbfounded how jupyter notebook doesn't return an error while not actually creating a port connection on the remote machine. Seeing as I can easily set up a port connection through python -m http.server 8888 I have no idea how to tackle this problem. Any idea on why jupyter doesn't seem to open a port connection and how this can be remedied?
I'm running jupyter-notebook 6.3.0 on Microsoft Windows [Version 10.0.19042.1165].
I've set the config file following the doc
c.NotebookApp.password = u'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
c.NotebookApp.ip = '*'
I can access the jupyter on my Win10 with chrome/edge browser with http://192.168.1.108:8888
I can ping to the Win10 (192.168.1.108) successfully from my Mac.
I cannot access the jupyter (http://192.168.1.108:8888) with chrome/edge browser from my Mac and get this error
xxx is currently unable to handle this request.
HTTP ERROR 503
How do I do?
Try jupyter notebook --ip <your_LAN_ip> --port 8888 Then visit http://your_LAN_ip:8888 from another computer.
Or
In your case replace the line c.NotebookApp.ip = '*' with c.NotebookApp.ip = '0.0.0.0' to listen on all IPs
And add these two lines
c.NotebookApp.allow_origin = '*' # allow access from anywhere
c.NotebookApp.disable_check_xsrf = True # allow cross-site requests
It's recommended that you use a password when accessing your notebook server. To set up a password, just run jupyter notebook password. To make it even more secure, you can use SSL for your server by passing the arguments --certfile and --keyfile to jupyter notebook
I'm trying to connect to a remote jupyter notebook.
Server-side actions:
I simply use jupyter notebook command that produces the following output:
http://localhost:8888/?token=c7a760ee5387de7d6a1cb797a0685a116621f8b3b5a1a5ba
I know that there's password authentication procedure as well. I set up the jupyter_notebook_config.py file. I changed the c.NotebookApp.password and c.NotebookApp.open_browser variables.
Client-side actions:
Since I'm using Putty I can copy/paste the HTTP address (with token) to a local browser. I get the following page:
Even though I'm using the token from the link (step 1) and password (step 2) I get the Invalid Credentials error.
There's a proxy server between the local machine and the server but I don't know how to account for that fact.
Update 11.10.2019
I decided to tweak some parameters in .jupyter/jupyter_notebook_config.py file. By sacrificing security I did away with token authentication by setting c.NotebookApp.token=''. I still get the Invalid credentials message.
jupyter_notebook_config.py which resides in .jupyter directory (in the home directory of the user) is created with jupyter notebook --generate-config. All of the options are commented out. You need to find c.NotebookApp.ip variable that must not be commented out and set its value to the IP of the server the Jupyter is running on. If you want to connect to that instance of Jupyter from another machine you need to find localhost:port webpage with a browser of your choosing. My answer assumes that you've forwarded the port you are using.
When using Jupyter Notebook on Windows 10 and starting multiple notebooks, each would open on the next available port (the first would be on port 8888, the next on 8889, etc.). I installed Anaconda on Windows Subsystem for Linux (WSL) and have had no issues, except when I try to start another notebook, it opens the same page wherever my previous notebook was started. Manually setting the port on startup like jupyter notebook --port 8889 works, but now I'm spoiled with letting jupyter figure it out for me.
I had to set an alias for the default browser, which is a Windows executable (export BROWSER='/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'). Additionally, I've generated a notebook configuration file, but I haven't figured out if it's doing anything.
Thank you!
I'm not exactly sure what your question is but I may be able to help you with your config file and default browser.
The following is my jupyter_notebook_config.py file:
c = get_config()
c.NotebookApp.browser = 'chrome.exe -incognito --app=%s'
c.NotebookApp.open_browser = True
chrome.exe is the windows executable file for google chrome which is put on my $PATH variable as follows:
export PATH=/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application:$PATH
The -incognito flag starts chrome in incognito mode. This results in the nice incognito dark theme and insures that the chrome extensions don't interfere with anything
The --app=%s flag is REALLY great, it starts the web page in "application mode" which removes the tab bar from the chrome window.
P.S. I'm also annoyed about the port issue and haven't found a nice work around.
Hope this helps!
I've installed jupyter on local network LAN but im unable to access http://<IP>:8888 from another macine on LAN. I've opened ports 8888 and port range 49152 to 65535 with iptables (this range is specified at http://jupyter-notebook.readthedocs.io/en/latest/public_server.html)
This guide http://jupyter-notebook.readthedocs.io/en/latest/public_server.html describes exposing a notebook publicly but I'm just attempting to share over LAN.
Have I missed a step ?
Try jupyter notebook --ip <your_LAN_ip> --port 8888
Then visit http://your_LAN_ip:8888 from another computer.
It's recommended that you use a password when accessing your notebook server. To set up a password, just run jupyter notebook password. To make it even more secure, you can use SSL for your server by passing the arguments --certfile and --keyfile to jupyter notebook. You can read more about setting that up here.
In macOS, the following worked for me
0. Generate configure file using
jupyter notebook --generate-config
1. Set in configure file and add
c.NotebookApp.ip = '0.0.0.0' # listen on all IPs
c.NotebookApp.token = '' # disable authentication
c.NotebookApp.allow_origin = '*' # allow access from anywhere
c.NotebookApp.disable_check_xsrf = True # allow cross-site requests
2. Run:
jupyter notebook --ip <your_LAN_ip> --port 8888
It's also possible to add the IP/host in the configuration file in the c.NotebookApp.ip = '<your_ip_or_hostname>' and c.NotebookApp.port = 8888 parameters.
If you don't have a jupyter configuration file yet run jupyter notebook --generate-config